Use =INDEX(return_range, MATCH(lookup_value, lookup_range, 0)) to find a value in one column and return the matching value from another column, even when the return column is to the left of the lookup column.
=INDEX(B2:B8,MATCH("Pens",A2:A8,0))
You have a table where the column you want to return is to the left of the column you search in, or you want a more flexible lookup than VLOOKUP. INDEX MATCH handles both: it finds the row with MATCH and then picks the value from that row with INDEX.
Step by step
- Click the cell where you want the result (for example D2).
- Type
=INDEX(and select the column or range that contains the value you want to return, then type a comma. - Type
MATCH(and select the cell that holds the value you are looking up, then a comma. - Select the column or range that contains the lookup values, type
,0)and close the INDEX with). - Press Enter. The formula should look like
=INDEX(B2:B10,MATCH(F2,A2:A10,0)). - Copy the formula down or across if you need it for more rows.
Try it here
Examples
1 Basic INDEX MATCH: find a price by item name
MATCH finds the row where A equals "Pens" (row 2), and INDEX returns the value from the same row in column B. The result is 4.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Item | Price | |||
| 2 | Pens | 4 | 4 | ||
| 3 | Pencils | 2 | |||
| 4 | Erasers | 1.5 | |||
| 5 | Notebooks | 3 | |||
| 6 | Markers | 2.5 | |||
| 7 | Folders | 1.2 | |||
| 8 | Staples | 0.8 | |||
| 9 |
=INDEX(B2:B8,MATCH("Pens",A2:A8,0))2 Look up a value to the left of the key
Here the key is in column B and the value to return is in column A, which VLOOKUP cannot do without rearranging. MATCH finds "Erasers" in row 4, and INDEX returns "Office" from A4.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Category | Item | |||
| 2 | Office | Pens | Office | ||
| 3 | Office | Pencils | |||
| 4 | Office | Erasers | |||
| 5 | School | Notebooks | |||
| 6 | Art | Markers | |||
| 7 | Office | Folders | |||
| 8 | Office | Staples | |||
| 9 |
=INDEX(A2:A8,MATCH("Erasers",B2:B8,0))3 Use a cell reference as the lookup value
The lookup value is in F2, so you can change it without editing the formula. MATCH finds "Markers" in row 6, and INDEX returns 2.5 from B6.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Item | Price | |||||
| 2 | Pens | 4 | 2.5 | Markers | |||
| 3 | Pencils | 2 | |||||
| 4 | Erasers | 1.5 | |||||
| 5 | Notebooks | 3 | |||||
| 6 | Markers | 2.5 | |||||
| 7 | Folders | 1.2 | |||||
| 8 | Staples | 0.8 | |||||
| 9 |
=INDEX(B2:B8,MATCH(F2,A2:A8,0))Other ways to do it
| Formula | Use it when |
|---|---|
=XLOOKUP(lookup_value, lookup_range, return_range) | You have Excel 365 or 2021 and want a simpler formula that also works left-to-right and has built-in not-found handling. |
=VLOOKUP(lookup_value, table_range, column_number, FALSE) | The return column is to the right of the lookup column and you are comfortable counting columns. |
Practise it
Free exercises with instant feedback. No sign-up needed.
Common mistakes
- The MATCH range and the INDEX range have different sizes, so the row number points to the wrong row. Make both ranges the same number of rows, for example B2:B8 and A2:A8, and lock them with $ if you copy the formula.
- You forget the 0 (or FALSE) in MATCH, so it does an approximate match and returns the wrong row. Always use
MATCH(value, range, 0)for an exact match. - The formula returns #N/A because the lookup value has extra spaces or is a number stored as text. Check with
=TRIM()or=ISNUMBER()and clean the data, or use=INDEX(B2:B8,MATCH(TRIM(F2),A2:A8,0)).
Questions people also ask
Can INDEX MATCH look to the left?
Yes. Unlike VLOOKUP, INDEX MATCH can return a value from any column, including one to the left of the lookup column.
Is INDEX MATCH better than VLOOKUP?
It is more flexible and does not break when you insert columns, but XLOOKUP is simpler if your Excel version has it.
Why do I get #N/A with INDEX MATCH?
The lookup value was not found exactly. Check for extra spaces, different data types, or a wrong range.
Functions used
Every formula on this page was checked by SheetSkill’s spreadsheet engine. All how-to guides