Learn › Article
How to Use VLOOKUP in Excel: Worked Example
VLOOKUP finds a value in the first column of a table and returns something from another column in the same row. The pattern is =VLOOKUP(lookup_value, table_array, col_index_num, FALSE). Use FALSE at the end when you want an exact match, which is what most assignments need.
The four arguments
| Argument | What it means |
|---|---|
lookup_value | The value you are searching for, usually a cell reference |
table_array | The table to search. The value you look up must be in its first column |
col_index_num | Which column of the table to return, counting from 1 at the left of the table |
range_lookup | FALSE for an exact match, TRUE for an approximate match. If you leave it out, Excel uses TRUE |
Two things trip students up. First, the column number counts inside your table range, not from column A of the sheet. Second, VLOOKUP can only return values to the right of the column it searches.
Worked example: look up a price
Type this small product table into a blank sheet:
| A | B | C | |
|---|---|---|---|
| 1 | ID | Product | Price |
| 2 | 101 | Notebook | 3.50 |
| 3 | 102 | Pen | 1.20 |
| 4 | 103 | Stapler | 8.75 |
| 5 | 104 | Folder | 2.10 |
| 6 | 105 | Marker | 2.95 |
Now type 103 in cell E2 and follow these steps:
- Click cell F2, where the answer will go.
- Type
=VLOOKUP(E2,A2:C6,2,FALSE)and press Enter. - The cell shows Stapler, because column 2 of the table (Product) is returned for ID 103.
- In G2, type
=VLOOKUP(E2,A2:C6,3,FALSE). It shows 8.75, the price from column 3.
Change E2 to 101 and both cells update to Notebook and 3.5. (Excel displays 3.5 unless you apply a number format with two decimals.)
Lock the table with dollar signs
If you copy the formula down a column, a normal range shifts with each row and the lookup breaks. Fix it with absolute references:
=VLOOKUP(E2,$A$2:$C$6,3,FALSE)
Now you can use the result in a calculation. Type a quantity of 4 in E3 and, with 103 still in E2, use:
=VLOOKUP(E2,$A$2:$C$6,3,FALSE)*E3
The lookup returns 8.75, and 8.75 × 4 = 35.
Handle missing values
If you type 999 in E2, no ID matches and VLOOKUP returns #N/A. To show a friendly message instead, wrap it:
=IFNA(VLOOKUP(E2,$A$2:$C$6,3,FALSE),"Not found")
This returns Not found for 999. IFNA only catches #N/A, so other mistakes such as a bad column number still show up. IFNA is available in Excel 2013 and later. In older versions, use IFERROR, which hides every kind of error.
Approximate match for bands and grades
Set the last argument to TRUE (or leave it out) when you want the closest value that does not go over. This suits bands such as score ranges or tax-style brackets. The first column must be sorted from smallest to largest.
Type this in H1:I6:
| H | I | |
|---|---|---|
| 1 | Min score | Grade |
| 2 | 0 | F |
| 3 | 60 | D |
| 4 | 70 | C |
| 5 | 80 | B |
| 6 | 90 | A |
Then use:
=VLOOKUP(85,H2:I6,2,TRUE)
This returns B. Excel finds the largest minimum score that is 85 or lower, which is 80.
Fix common VLOOKUP errors
| Problem | Likely cause | Fix |
|---|---|---|
#N/A | The value is not in the first column, or has a typo or extra space | Check spelling and spaces, and make sure you are searching the first column of the table |
#N/A with a value that looks right | One is a number and the other is text, such as 103 and "103" | Convert both to the same type |
#REF! | col_index_num is larger than the number of columns in the table | Use a smaller number or widen the table range |
#VALUE! | col_index_num is less than 1 | Use 1 or higher |
| Wrong answer after copying down | The table range moved | Add $ signs to the range |
When VLOOKUP is not enough
VLOOKUP cannot look to the left, and a hard-coded column number can break if someone inserts a column in your table. XLOOKUP solves both problems, but it is only available in Excel 2021 and Microsoft 365, not in older versions. See how to use XLOOKUP instead of VLOOKUP. Many assignments still ask for VLOOKUP by name, so it is worth knowing both.
Stuck on the whole assignment?
If your task has several lookups, checks and calculations, it is easy to lose track of which range and column number go where. Excelerant builds the real Excel workbook for a whole assignment from the instructions and the starter file, and explains every step. You can upload your assignment to Excelerant and see how each VLOOKUP is set up.
Frequently asked questions
Why does VLOOKUP return #N/A when the value is clearly in my table?
The usual causes are extra spaces, a number stored as text, or searching a column that is not the first column of your table range. Fix the data type or the range, and check that the last argument is FALSE for an exact match.
Can VLOOKUP return more than one column at once?
A single VLOOKUP returns one value. To get several columns, write one formula per column with a different col_index_num, such as 2 for the product and 3 for the price.
Is VLOOKUP case sensitive?
No. =VLOOKUP("pen",B2:C6,2,FALSE) treats "pen" and "Pen" as the same text and returns 1.2 for the example table. It does still care about spelling and spaces.