Prices by code. Look up the code in A5.
ABC
1CodeNamePrice
2P110Item A12
3P245Item B30
4P390Item C7
5P245

In B5, write =VLOOKUP(A5,$A$2:$C$4,3,FALSE) and it shows 30.

The four arguments

VLOOKUP(lookup_value, table, column, exact) takes the value to find, the table to search, the number of the column to return counted from the first column of the table, and whether the match must be exact.

The search always happens in the first column of the table. The column number counts from there, so in a table that starts at F the third column is H.

Exact and approximate matches

FALSE asks for an exact match and returns #N/A when the value is missing. TRUE, which is also what you get when you leave the argument out, asks for the largest value that does not exceed the one you gave. That suits bands such as tax tiers or grades, and it needs the first column sorted from smallest to largest.

On unsorted data an approximate match can return the wrong row and show no error. If you are looking up codes or names, use FALSE.

Three mistakes that fail on new data

These pass on the numbers you can see and fail when the data changes:

Practise it

Module 3, Lookups, has 20 tasks on this, each checked on hidden data: open module 3. You can also try formulas in the sandbox.

Related guides