What VLOOKUP does
VLOOKUP searches down the first column of a table for a value, then returns what’s in the same row of a column you choose. Give it a staff number and it can return the person’s department: =VLOOKUP(B8,A2:C6,3,FALSE) looks for the staff number from B8 in column A and returns column 3 of that row.
The V stands for vertical, because it searches down a column. VLOOKUP has been in every version of Excel for decades, so most workbooks you inherit at work use it. XLOOKUP does the same job with fewer catches in newer versions, but you’ll keep meeting VLOOKUP.
It has two ways of matching. With FALSE as the last argument it looks for the exact value. With TRUE it finds the band a number falls into, which is how tax tables and discount levels work.
Syntax
lookup_valueRequired- What to find in the table's first column, such as a staff number. Usually a cell like
B8. table_arrayRequired- The whole table, starting with the column to search:
A2:C6. The answer must be in a column to the right of the first one. col_index_numRequired- Which column of the table to return, counting from 1 at its left edge. In
A2:C6, column C is3. range_lookupOptionalFALSEfor an exact match, which is what most lookups need.TRUE, or leaving it out, finds the nearest value below in a table sorted from smallest to largest.
Example: find a colleague’s department
The staff list is in A1:C6. A staff number goes in B8, and B9 returns the department from the table’s third column.
Read it as: look for B8 in the first column of A2:C6, and return column 3 of the row it’s in, exact matches only. Change the 3 to 2 and it returns the name instead.
Example: find the commission band for a sales figure
Commission rates depend on bands: 2% from €0, 3% from €10,000, 4% from €25,000 and 5% from €50,000. The band table is in A7:B10, sorted from the smallest threshold to the largest, and the formula in C2 is filled down to C4.
With TRUE, VLOOKUP looks for the largest threshold that isn’t more than the sales figure. That only works when the first column is sorted from smallest to largest. The dollar signs keep the band table fixed when the formula is filled down.
How to do a VLOOKUP, step by step
- Click the cell where the answer should go and type
=VLOOKUP(. - Click the cell that holds the value to look up, such as a staff number, and type a comma.
- Select the table, on the same sheet or another one, starting with the column you search. Press F4 (Cmd+T on a Mac) to lock it with dollar signs, then type a comma.
- Type the number of the column to return, counting the table’s first column as 1, then
,FALSE)for an exact match, and press Enter.
Common mistakes
- Without the last argument, VLOOKUP uses
TRUEand returns the nearest value below. On an unsorted list that answer is wrong and no error warns you, so writeFALSEfor exact lookups every time. - VLOOKUP only returns columns to the right of the one it searches. When the answer is to the left, use XLOOKUP or INDEX with MATCH.
- Insert a column inside the table and
3points at a different column from then on. XLOOKUP and INDEX with MATCH don’t count columns, so they keep working. - Filled down,
A2:C6becomesA3:C7and the top rows drop out of the search. Lock the table with$A$2:$C$6. #N/Afor a value you can see usually means a trailing space, or a number stored as text on one side. Fix the data, or catch the missing values with IFERROR.
Frequently asked questions
What does FALSE mean in VLOOKUP?
FALSE asks for an exact match: VLOOKUP returns a result only when it finds exactly the value you’re looking for, and #N/A otherwise. TRUE asks for the nearest smaller value, for banded tables sorted in ascending order.
Why is my VLOOKUP returning #N/A?
It didn’t find the value in the first column of the table. Check for extra spaces, numbers stored as text, a table range that doesn’t reach the row, or a lookup value that isn’t in the first column.
Why is my VLOOKUP returning the wrong value?
Usually the last argument is missing or TRUE, so VLOOKUP takes the nearest smaller value instead of looking for an exact match. Add FALSE at the end. A column number that points at the wrong column, often because someone inserted a column in the table, gives wrong answers too.
How do I do a VLOOKUP from another sheet?
Put the sheet name in front of the table range, as in =VLOOKUP(B2,Staff!$A$2:$C$50,3,FALSE). Excel writes the name for you if you click the other sheet’s tab while you select the table. Names with spaces get single quotes, such as 'Staff list'!$A$2:$C$50.
Can VLOOKUP look up to the left?
No. It always searches the first column of the table and returns a column to its right. XLOOKUP, or INDEX with MATCH, can return a column on either side.
Can VLOOKUP use two criteria?
Not by itself, because it searches one column. Add an extra column at the left edge of the table that joins the two values, such as =B2&C2, then look up both values joined the same way: =VLOOKUP(F1&F2,A2:D20,4,FALSE).