How to use VLOOKUP in Excel: step-by-step with examples
VLOOKUP finds a value by code in a price list or staff directory. Syntax, why FALSE matters, the causes of #N/A and pro techniques — all with examples.
VLOOKUP searches for a value in the first column of a table and returns data from another column in the same row. The name stands for “vertical lookup” — searching from top to bottom.
A real-life example: a shop has a price list of 500 products, but an order only contains codes. Instead of hunting for each code by eye, VLOOKUP fills in the price instantly. The same goes for an employee’s department by staff number, or a student’s group by ID.
VLOOKUP is one of the most used — and most misused — functions in Excel. This topic covers both sides.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Order | Price | ||
| 2 | M01 | Bread | 4 000 | M031 | 9 000 | ||
| 3 | M02 | Milk | 12 000 | M05 | 18 000 | ||
| 4 | M032 | Yogurt | 9 0003 | M01 | 4 000 | ||
| 5 | M04 | Eggs | 1 500 | ||||
| 6 | M05 | Rice | 18 000 | ||||
| 7 |
Syntax
=ВПР(lookup_value; table_array; col_index_num; [range_lookup])
lookup_value— what to find: a code, name or ID. Usually a cell reference (E2).table_array— where to look. The lookup value must be in the first (leftmost) column of this range.col_index_num— which column of the table to return. Counting starts at the table, not the sheet: in A2:C6, Price is column 3.range_lookup—FALSE(or 0) for an exact match only;TRUEor omitted for an approximate match.
Four questions to remember it by: What? Where? Which column? Exact?
Writing VLOOKUP step by step
1
Select the result cell (F2). On the Формулы tab, click Ссылки и массивы and pick VLOOKUP from the list.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Order | Price | ||
| 2 | M01 | Bread | 4000 | M03 | |||
| 3 | M02 | Milk | 12000 | M05 | |||
| 4 | M03 | Yogurt | 9000 | M01 | |||
| 5 |
2
Fill in the Function Arguments box: Lookup_value — click E2; Table_array — drag over A2:C6 and press F4 straight away so it becomes $A$2:$C$6; Col_index_num — 3; Range_lookup — FALSE.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Order | Price | ||
| 2 | M01 | Bread | 4000 | M03 | |||
| 3 | M02 | Milk | 12000 | M05 | |||
| 4 | M03 | Yogurt | 9000 | M01 | |||
| 5 | M04 | Eggs | 1500 | ||||
| 6 | M05 | Rice | 18000 | ||||
| 7 |
3
Click OK. Then double-click the fill handle in the bottom-right corner of F2 to copy the formula to the other orders. Thanks to $, the table stays put — only E2 → E3 → E4 changes.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Order | Price | ||
| 2 | M01 | Bread | 4 000 | M03 | 9 000 | ||
| 3 | M02 | Milk | 12 000 | M05 | 18 000 | ||
| 4 | M03 | Yogurt | 9 000 | M01 | 4 000 | ||
| 5 | M04 | Eggs | 1 500 | ||||
| 6 | M05 | Rice | 18 000 | ||||
| 7 |
Approximate match (TRUE): sales volume → bonus rate
Sometimes you need a bracket rather than an exact value: a salesperson sold 7.2 million soums this month — which bonus tier is that? List the lower limit of each tier in the table and pass TRUE as the 4th argument.
In TRUE mode, VLOOKUP finds the closest value that is not greater than the one you look up. There is one condition: the first column must be sorted in ascending order, otherwise the result is random.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Sales, soum | Bonus | Seller | Sales | Bonus | ||
| 2 | 0 | 0% | Aziz | 3 500 000 | 3% | ||
| 3 | 2 000 000 | 3% | Dilnoza | 7 200 0001 | 5% | ||
| 4 | 5 000 0002 | 5% | Javohir | 12 000 000 | 8% | ||
| 5 | 10 000 000 | 8% | Malika | 1 500 000 | 0% | ||
| 6 | 20 000 000 | 10% | |||||
| 7 |
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Order | Price | ||
| 2 | M01 | Bread | 4 000 | M04 | 9 0001 | ||
| 3 | M02 | Milk | 12 000 | ||||
| 4 | M03 | Yogurt | 9 000 | ||||
| 5 | M05 | Rice | 18 000 | ||||
| 6 |
Pro level: get the column number with MATCH
Instead of a hard-coded 3, calculate the column number from the header with MATCH:
=ВПР($A8;$A$1:$D$5;ПОИСКПОЗ(B$7;$A$1:$D$1;0);ЛОЖЬ)
Now the formula keeps working even if you insert or reorder columns. Fill it to the right and every header picks up its own column. Note that the table and the header row must start in the same column (A) so the number from MATCH lines up with VLOOKUP’s column number.
Three more pro techniques:
=ЕСНД(ВПР(E2;$A$2:$C$6;3;ЛОЖЬ);"Not found")shows a clear message instead of #N/A.IFERRORworks too, but it also hides other errors (such as #REF! from a wrong column number).- Wildcards:
=ВПР("Sam*";A2:C10;2;ЛОЖЬ)returns the first value that starts with “Sam”.?stands for any single character. - Two-criteria lookup: add a helper column at the start of the table, e.g.
=B2&"|"&C2, and look up a combined key like"Aziz|Tashkent".
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Staff No | Name | Department | Salary | |
| 2 | T-101 | Aziz | Sales | 6 500 000 | |
| 3 | T-102 | Dilnoza | Accounting | 7 200 000 | |
| 4 | T-103 | Javohir | IT | 9 800 000 | |
| 5 | T-104 | Malika | Sales | 5 900 000 | |
| 6 | |||||
| 7 | Staff No | Name | Department | Salary | |
| 8 | T-103 | Javohir | IT | 9 800 000 | |
| 9 |
Try it in the simulator
The price list is on the left. Type =ВПР(E2;$A$2:$C$6;3;ЛОЖЬ) in F2 and fill it down to F5. Code M07 in E5 is not in the list — change the formula in F2 to =ЕСНД(ВПР(E2;$A$2:$C$6;3;ЛОЖЬ);"Not found") and fill it down again.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Order | Price | |||||||||||||||||||
| 2 | M01 | Bread | 4000 | M03 | ||||||||||||||||||||
| 3 | M02 | Milk | 12000 | M05 | ||||||||||||||||||||
| 4 | M03 | Yogurt | 9000 | M01 | ||||||||||||||||||||
| 5 | M04 | Eggs | 1500 | M07 | ||||||||||||||||||||
| 6 | M05 | Rice | 18000 | |||||||||||||||||||||
| 7 | ||||||||||||||||||||||||
| 8 | ||||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.