Lookups: XLOOKUP and VLOOKUP
A lookup finds a value in a table, like finding a price by product name.
Lookups connect tables. You might have a price list in one sheet and an order list in another, with only product codes in the orders. Instead of copying prices by hand (slow and error-prone), a lookup finds each code in the price list and brings back its price - for thousands of rows at once. Lookups are among the most asked-about Excel skills in interviews.
The value you search for must be in a column that uniquely identifies each row, like a product code, employee ID or roll number. Names can repeat or be typed differently, so codes are safer.
A B C
1 Code Item Price
2 P101 Pen 20
3 N205 Notebook 60
4 B310 Bag 900XLOOKUP (Microsoft 365, Excel 2021 and later, Google Sheets)
=XLOOKUP("N205", A2:A4, C2:C4) → 60
=XLOOKUP("Bag", B2:B4, A2:A4) → B310
=XLOOKUP("X999", A2:A4, C2:C4, "Not found") → Not foundXLOOKUP is the modern, easier lookup: the search column and the result column are separate, so the result can be to the left or right, and you can set a "not found" message. Use it if your Excel version has it.
It means: look for this value, in this column, and give back the matching value from that column.
VLOOKUP (works in every version)
=VLOOKUP("N205", A2:C4, 3, FALSE) → 60- Look for "N205" in the first column of A2:C4.
- Give back the value from the 3rd column of that range.
FALSEmeans an exact match. Always add it for codes and names.
#N/A means the value was not found. Check for extra spaces or a typo.- Lookups find a value in a table and return related data.
- XLOOKUP: what to find, where to look, what to return.
- VLOOKUP: always use FALSE for an exact match.
- #N/A means not found - check spaces and spelling.
