Excel tutorial
/

Functions

Intermediate

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.

Книга1 - Excel
—☐✕
F2fx=ВПР(E2;$A$2:$C$6;3;ЛОЖЬ)
ABCDEFG
1CodeProductPriceOrderPrice
2M01Bread4 000M0319 000
3M02Milk12 000M0518 000
4M032Yogurt9 0003M014 000
5M04Eggs1 500
6M05Rice18 000
7
Готово
The formula in F2 finds code M03 (1) in column A (2) and returns the price from the 3rd column of that row (3)

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; TRUE or 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.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить функциюАвтосуммаФинансовыеЛогическиеТекстовыеДата и времяСсылки и массивыМатематические
Библиотека функций
Диспетчер имён
Определённые имена
F2fx
ABCDEFG
1CodeProductPriceOrderPrice
2M01Bread4000M03
3M02Milk12000M05
4M03Yogurt9000M01
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.

Книга1 - Excel
—☐✕
F2fx
ABCDEFG
1CodeProductPriceOrderPrice
2M01Bread4000M03
3M02Milk12000M05
4M03Yogurt9000M01
5M04Eggs1500
6M05Rice18000
7
ГотовоСреднее: 8900Количество: 15Сумма: 44500

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.

Книга1 - Excel
—☐✕
F4fx=ВПР(E4;$A$2:$C$6;3;ЛОЖЬ)
ABCDEFG
1CodeProductPriceOrderPrice
2M01Bread4 000M039 000
3M02Milk12 000M0518 000
4M03Yogurt9 000M014 000
5M04Eggs1 500
6M05Rice18 000
7
ГотовоСреднее: 10333,3333Количество: 3Сумма: 31000
In F4 the table is still $A$2:$C$6 — only the lookup cell moved to E4

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.

Книга1 - Excel
—☐✕
F3fx=ВПР(E3;$A$2:$B$6;2;ИСТИНА)
ABCDEFG
1Sales, soumBonusSellerSalesBonus
200%Aziz3 500 0003%
32 000 0003%Dilnoza7 200 00015%
45 000 00025%Javohir12 000 0008%
510 000 0008%Malika1 500 0000%
620 000 00010%
7
Готово
7,200,000 is not in the table — VLOOKUP takes the closest lower limit (5,000,000) and returns 5%
Книга1 - Excel
—☐✕
F2fx=ВПР(E2;$A$2:$C$5;3)
ABCDEFG
1CodeProductPriceOrderPrice
2M01Bread4 000M049 0001
3M02Milk12 000
4M03Yogurt9 000
5M05Rice18 000
6
Готово
The trap: M04 is not in the list, but with the 4th argument omitted VLOOKUP raised no error — it quietly returned the yogurt price (9,000)

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. IFERROR works 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".
Книга1 - Excel
—☐✕
C8fx=ВПР($A8;$A$1:$D$5;ПОИСКПОЗ(C$7;$A$1:$D$1;0);ЛОЖЬ)
ABCDE
1Staff NoNameDepartmentSalary
2T-101AzizSales6 500 000
3T-102DilnozaAccounting7 200 000
4T-103JavohirIT9 800 000
5T-104MalikaSales5 900 000
6
7Staff NoNameDepartmentSalary
8T-103JavohirIT9 800 000
9
ГотовоСреднее: 9800000Количество: 3Сумма: 9800000
B8:D8 hold one and the same formula: MATCH takes the column number from the header, so you just fill it to the right

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.

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1CodeProductPriceOrderPrice
2M01Bread4000M03
3M02Milk12000M05
4M03Yogurt9000M01
5M04Eggs1500M07
6M05Rice18000
7
8
9
10
Лист1
Готово

Has ExcelLab been useful?

Support the project and help us release new lessons and exercises.

Support us
Previous

94 / 154