How VLOOKUP works
VLOOKUP finds a value in the first column of a table, then returns something from the same row, a set number of columns to the right. Think of it as "find this ID, then read across to the price."Find a value in the first column of a table, then read across to the column you want.
Use FALSE when you look up IDs, names or codes. Use TRUE only for ranges, like tax brackets or shipping bands, and only when the first column is sorted from smallest to largest.
#N/A
The ID isn't in the first column, or has a stray space. TRIM fixes the space.
Wrong column
Count columns inside table_array, not from column A of the sheet.
Unlocked range
Fill down and A2:C7 slides to A3:C8. Lock it: $A$2:$C$7.
Missing FALSE
Without it you can get a confident, wrong answer from the row above.
Numbers stored as text
104 and "104" don't match. Look for the green triangle in the corner.
XLOOKUP can look left, defaults to an exact match and doesn't need a column number: =XLOOKUP(E2, A2:A7, C2:C7). It's only in newer versions of Excel, and older workbooks are full of VLOOKUP, so learn both.
2Return the product name for P-106 using the same table (A2:C7).Show formulaHide
Product is the 2nd column of A2:C7, so col_index_num changes from 3 to 2.
3Fix a lookup that returns #N/A because E2 contains a stray space ("P-102 ").Show formulaHide
TRIM strips leading and trailing spaces from the lookup value before VLOOKUP searches column A.
4Lock the table range so the formula can be copied down from F2 to F10.Show formulaHide
Dollar signs lock A2:C7 while E2 stays relative so each row looks up its own ID.
Why does VLOOKUP return #N/A when the value is clearly there?
The two values are not exactly the same, or the value is not in the first column of the table. Look for a stray space ("P-102 " is not "P-102"), a number stored as text, or a table that starts one column too far right. TRIM removes extra spaces, and the table must start at the column you search.
Can VLOOKUP look to the left?
No. VLOOKUP searches the first column of the table and can only return columns to its right. To look left, use XLOOKUP, for example =XLOOKUP(E2, A2:A7, C2:C7), or INDEX with MATCH.
Will VLOOKUP come up in an Excel interview test?
Lookups are one of the most common tasks in Excel skills tests, usually next to SUMIF, IF and basic formatting. Practise until you can write a VLOOKUP with an exact match without checking the syntax, and know what #N/A means.