Excel Guide

How to Use INDEX and MATCH in Excel: Look Left, and Stop Counting Columns

=INDEX(return_range, MATCH(lookup_value, lookup_range, 0)). MATCH finds where something is; INDEX returns what is at that position. Together they do everything VLOOKUP does, plus the one thing VLOOKUP cannot: look to the left. Practise it: INDEX and MATCH — 10 Excel practice problems.

MATCH first: find the position

MATCH takes a value, a range, and a match type, and returns the position number:

=MATCH(D1, A1:A5, 0)

The 0 means exact match — find exactly this value, nothing close. Worked through on PractiseSkills' INDEX and MATCH topic page, with D1 = "Priya" and A1:A5 = Alex, Sam, Priya, Chen, Lena, that returns 3 — Priya is the third item in the list. MATCH never returns the value itself, only its position. That is the whole point: the position is what INDEX needs.

INDEX next: return the value at a position

INDEX takes a range and a position number, and returns the value sitting there:

=INDEX(A1:A5, 3)

Over A1:A5 = 10, 20, 30, 40, 50, that returns 30 — the third value. On its own INDEX is just "give me the nth item". Combined with MATCH, it becomes a lookup: MATCH finds the row, INDEX fetches the value from it.

Putting them together

Say column A holds product names and column B holds prices. To find the price of the product named in D1:

=INDEX(B1:B4, MATCH(D1, A1:A4, 0))

Read it inside out. MATCH looks for D1's value in A1:A4 and returns its row number. INDEX then takes that row number and returns the value from the same row in B1:B4. On the topic page's example, D1 = "Gizmo" and the formula returns 8 — Gizmo's price. If D1 changes to another product, the same formula returns that product's price. Nothing in the formula hard-codes a row.

The one thing VLOOKUP cannot do: look left

VLOOKUP only searches the first column of its table and returns a value from a column to the right. If the value you want sits to the left of the column you are searching — the price is in column A and the product name is in column B, say — VLOOKUP cannot do it at all. INDEX/MATCH has no such restriction: the range INDEX returns from and the range MATCH searches are independent, so the answer can come from any column, left or right. PractiseSkills drills exactly this case in its fourth exercise, "Use INDEX/MATCH to Look Left".

There is a second, quieter advantage. VLOOKUP takes a column number — 3 means "the third column of the table". Insert a column in the middle of that table and the 3 now points at the wrong column, silently returning the wrong answer. INDEX/MATCH points at real ranges (B1:B4, A1:A4), so inserting a column does not shift what it returns. The formula keeps working because it never counted columns in the first place.

The two mistakes that break INDEX/MATCH

1. Forgetting the 0 in MATCH. =MATCH(D1, A1:A5) without the third argument does an approximate match, which assumes the list is sorted and can return a wrong position from an unsorted list. For a lookup, always write the 0: exact match, every time.

2. Ranges that do not line up. INDEX and MATCH are two halves of one lookup, so their ranges must describe the same rows. If MATCH searches A1:A4 but INDEX returns from B1:B6, the row number can point past the data or at the wrong item. Keep both ranges the same height and starting on the same row, and the pair stays honest.

INDEX/MATCH, VLOOKUP, and XLOOKUP — which to learn?

All three do lookups, and PractiseSkills covers all three. VLOOKUP is the one interviewers still ask for first, and it is the simplest when the answer is to the right. XLOOKUP is the modern replacement: it looks left too, and it needs no column number. INDEX/MATCH is the combination worth learning anyway, because it works in every version of Excel — including older ones where XLOOKUP does not exist — and because understanding the two halves separately makes every other lookup easier to read. Learn VLOOKUP for the interview, XLOOKUP for new work, and INDEX/MATCH for the files other people built years ago.

Practise it

The INDEX and MATCH topic page has 10 exercises that build up step by step — finding a position with MATCH, retrieving a value with INDEX, combining the two for a lookup, looking left, finding an employee's row, looking up a score, retrieving the nth item, finding the position of the highest score, and looking up a vendor term and a bin location. Three are free with worked solutions and no sign-up needed; the rest are graded on the formula you write in the live spreadsheet. Start with VLOOKUP first if the basic lookup is not solid yet, and browse the full list of 75 topics on the practice hub.

Try it yourself

Practice INDEX and MATCH with real interactive exercises and instant feedback.

Start practicing INDEX and MATCH →