Excel tutorial
/

Functions

Advanced

INDEX MATCH in Excel: left lookups and two-way lookups step by step

INDEX and MATCH together do what VLOOKUP can’t: look left, look up by row and column, match two criteria. How to build the formula, plus traps.

INDEX MATCH isn’t one function but a pair: MATCH finds the position of a value, and INDEX takes the value at that position from another column. Like finding the address first and then opening the door.

Why analysts love it:

  • It looks in any direction — even when the result column is on the left.
  • Two-way lookups: it finds the intersection of a row header and a column header.
  • It doesn’t break when columns are inserted — there is no column number.
  • It works in every version of Excel, unlike XLOOKUP.

Example: find a product’s code by its name. The code column is to the left of the names — VLOOKUP is helpless here.

Книга1 - Excel
—☐✕
F2fx=ИНДЕКС(A2:A6;ПОИСКПОЗ(F1;B2:B6;0))
ABCDEFG
1CodeProductPriceProduct:Milk1
2M01Bread4 000Code:M02
3M023Milk212 000
4M03Yogurt9 000
5M04Eggs1 500
6M05Rice18 000
7
Готово
MATCH finds “Milk” (1) in column B — position 2 (2), and INDEX takes the code at position 2 of column A (3)

How the formula is built

One-way lookup:

=ИНДЕКС(return_range; ПОИСКПОЗ(lookup_value; lookup_range; 0))

  • return_range — the column to return from (A2:A6).
  • lookup_value — what to find (F1).
  • lookup_range — where to look (B2:B6). It must start on the same row as return_range.
  • 0 — exact match.

Two-way lookup — MATCH twice:

=ИНДЕКС(table; ПОИСКПОЗ(row_value; row_headers; 0); ПОИСКПОЗ(col_value; col_headers; 0))

Read the formula from the inside out: first MATCH produces a number, then INDEX uses it.

Building the formula from the inside out

1

Start with MATCH alone. Type =ПОИСКПОЗ(F1;B2:B6;0) in F2 (via Формулы → Ссылки и массивы → MATCH, or by hand). The result is 2: milk is in position 2.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить функциюАвтосуммаФинансовыеЛогическиеТекстовыеДата и времяСсылки и массивыМатематические
Библиотека функций
Диспетчер имён
Определённые имена
F2fx=ПОИСКПОЗ(F1;B2:B6;0)
ABCDEFG
1CodeProductPriceProduct:Milk
2M01Bread4 000Position:2
3M02Milk12 000Code:
4M03Yogurt9 000
5M04Eggs1 500
6M05Rice18 000
7
ГотовоКоличество: 5

2

In F3, write INDEX and give it F2 as the row number: =ИНДЕКС(A2:A6;F2). The result is M02. With two helper cells the logic is plain to see.

Книга1 - Excel
—☐✕
F3fx=ИНДЕКС(A2:A6;F2)
ABCDEFG
1CodeProductPriceProduct:Milk
2M01Bread4 000Position:21
3M022Milk12 000Code:M02
4M03Yogurt9 000
5M04Eggs1 500
6M05Rice18 000
7
ГотовоКоличество: 5

3

Now combine them: replace F2 inside INDEX with the MATCH formula itself — =ИНДЕКС(A2:A6;ПОИСКПОЗ(F1;B2:B6;0)). The helper cell is no longer needed.

Книга1 - Excel
—☐✕
F2fx=ИНДЕКС(A2:A6;ПОИСКПОЗ(F1;B2:B6;0))
ABCDEFG
1CodeProductPriceProduct:Milk
2M01Bread4 000Code:M02
3M02Milk12 000
4M03Yogurt9 000
5M04Eggs1 500
6M05Rice18 000
7
Готово

4

If you plan to fill the formula down, lock the ranges with F4: =ИНДЕКС($A$2:$A$6;ПОИСКПОЗ(F1;$B$2:$B$6;0)).

Two-way lookup: a delivery price

A courier price depends on two things: the region (row) and the weight (column). One MATCH finds the row number, the other finds the column number, and INDEX takes the price where they meet:

=ИНДЕКС(B2:D5;ПОИСКПОЗ(B6;A2:A5;0);ПОИСКПОЗ(B7;B1:D1;0))

Change the choices in B6 and B7 and the price updates by itself. This kind of “calculator” is perfect for tariff grids, tax rates and exchange-rate tables.

Книга1 - Excel
—☐✕
B8fx=ИНДЕКС(B2:D5;ПОИСКПОЗ(B6;A2:A5;0);ПОИСКПОЗ(B7;B1:D1;0))
ABCDE
1Region1 kg5 kg210 kg
2Tashkent15 00025 00040 000
3Samarkand25 00038 00055 000
4Bukhara130 00045 000365 000
5Khorezm35 00052 00075 000
6Region:Bukhara
7Weight:5 kg
8Price:45 000
9
Готово
Bukhara is row 3 (1), “5 kg” is column 2 (2), and where they meet — 45,000 soums (3)
Книга1 - Excel
—☐✕
F2fx=ИНДЕКС(A2:A6;ПОИСКПОЗ(F1;B1:B6;0))
ABCDEFG
1CodeProductPriceProduct:Milk
2M01Bread4 000Code:M031
3M02Milk12 000
4M03Yogurt9 000
5M04Eggs1 500
6M05Rice18 000
7
Готово
The trap: MATCH starts at B1 but INDEX starts at A2. Milk came out as position 3 and INDEX returned the yogurt code (M03) — no error, just wrong

Which one: VLOOKUP, INDEX MATCH or XLOOKUP?

  • VLOOKUP — the simplest; only looks right and breaks when columns are inserted. Fine for small, stable tables.
  • INDEX MATCH — works in every version, looks in any direction and in two dimensions, survives inserted columns. If the file is opened in different Excel versions, it is the safest choice.
  • XLOOKUP — the most convenient and shortest, but only in Excel 2021/365.

Rule of thumb: the file lives only in 365 — XLOOKUP; colleagues may have older Excel — INDEX MATCH.

Pro level: lookup by two criteria

You need sales for a branch and a month. There are two ways.

1. A helper column (all versions): add a key column such as =B2&"_"&C2 at the start of the table and build the lookup value the same way:

=ИНДЕКС(D2:D5;ПОИСКПОЗ(B7&"_"&D7;A2:A5;0))

2. An array formula (no helper column):

=ИНДЕКС(D2:D5;ПОИСКПОЗ(1;(B2:B5=B7)*(C2:C5=D7);0))

Each condition produces a TRUE/FALSE array; multiplied together, they give 1 only where both conditions hold, and MATCH looks for that 1. In Excel 365 a plain Enter is enough; in older versions press Ctrl + Shift + Enter.

Книга1 - Excel
—☐✕
B8fx=ИНДЕКС(D2:D5;ПОИСКПОЗ(B7&"_"&D7;A2:A5;0))
ABCDE
1KeyBranchMonthSales
2Tashkent_JanTashkentJan120
3Tashkent_FebTashkentFeb150
4Samarkand_JanSamarkandJan90
5Samarkand_FebSamarkandFeb95
6
7Branch:SamarkandMonth:Feb
8Sales:95
9
Готово
MATCH finds the key “Samarkand_Feb” in column A (position 4), and INDEX returns the sales — 95 million soums

Try it in the simulator

Type the two-way formula in B8: =ИНДЕКС(B2:D5;ПОИСКПОЗ(B6;A2:A5;0);ПОИСКПОЗ(B7;B1:D1;0)). Then type “Khorezm” in B6 and “10 kg” in B7 and check how the price changes.

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1Region1 kg5 kg10 kg
2Tashkent150002500040000
3Samarkand250003800055000
4Bukhara300004500065000
5Khorezm350005200075000
6Region:Bukhara
7Weight:5 kg
8Price:
9
10
11
12
Лист1
Готово

Has ExcelLab been useful?

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

Support us
Previous

100 / 154