Lookups · About 6 minutes
Look up with INDEX and MATCH
MATCH finds where something is in a list. MATCH( gives 4 if B9 is the 4th item. The 0 means exact match only.
INDEX picks the item at a position. INDEX( gives the 4th value in C2:C7.
Put them together: =INDEX( reads as "find where B9 is in B2:B7, then bring back the value at that spot in C2:C7". Like XLOOKUP it can look left, and it works in every version of Excel.
Part of Plus
Free during our founding launch: sign in to unlock this lesson's exercises, the timed practice sets and the rest of Plus. The free lessons stay free, with no account needed.
What INDEX and MATCH does
MATCH tells you where a value sits in a list, as a position number. INDEX brings back whatever is at a given position. Together they make a lookup that can reach any column, left or right.
Give INDEX a whole table and two MATCHes, one for the row and one for the column, and you get a two-way lookup: the value where a row and a column meet, like a room's bookings on one day. It works in every version of Excel and in Google Sheets.
How to write INDEX and MATCH
=INDEX(
- array
- The range to pick from: one column, or a whole table.
- row_num
- Which row of that range to bring back, counted from its top. Usually a MATCH goes here.
- column_num
- Optional. Which column of the range, counted from its left edge. You need it when the range has more than one column.
=MATCH(
- lookup_value
- What to find, like a name in a cell.
- lookup_array
- One row or one column to search.
- match_type
- Type
0for an exact match. It is optional, but leaving it out means 1, an approximate match that needs a sorted list.
INDEX and MATCH worked example
A grid shows how many bookings each meeting room has per day. In B9, find the bookings for the room in B7 on the day in B8.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Room | Mon | Tue | Wed |
| 2 | Oak | 4 | 6 | 3 |
| 3 | Pine | 2 | 5 | 7 |
| 4 | Elm | 8 | 1 | 4 |
| 5 | Ash | 3 | 3 | 6 |
| 6 | ||||
| 7 | Room | Pine | ||
| 8 | Day | Wed | ||
| 9 | Bookings | 7 |
=INDEX( B2:D5, MATCH( B7, A2:A5, 0), MATCH( B8, B1:D1, 0))Find Pine in A2:A5 (row 2) and Wed in B1:D1 (column 3), then bring back where row 2 and column 3 of B2:D5 meet. It shows 7.Common INDEX and MATCH mistakes
A believable answer from the wrong row
Add 0 as the last part of MATCH. Without it MATCH uses approximate match, which assumes a sorted list and can stop on the wrong item.
The answer is one row off
Start the INDEX range and the MATCH range on the same row, like C2:C7 and B2:B7. If one starts at row 1 and the other at row 2, every position is shifted by one.
An error in a two-way lookup
Point INDEX at the numbers only, like B2:D5, and match against the labels just outside it, A2:A5 and B1:D1. A position bigger than the range has nowhere to land.
INDEX and MATCH or XLOOKUP?
In Microsoft 365, Excel 2021 and later, and Google Sheets, XLOOKUP does a one-way lookup with less typing. Use INDEX and MATCH when the file must work in Excel 2019 or older, where XLOOKUP shows #NAME?, or when you need a two-way lookup in one tidy formula.
Both can look left, which VLOOKUP can't. And both point at the column to bring back, so inserting a column doesn't break them the way it breaks a VLOOKUP column number.
Questions people ask
Is INDEX MATCH better than VLOOKUP?
It's more flexible: it can look left, and it doesn't break when someone inserts a column. It also works in every Excel version.
What does the 0 mean in MATCH?
0 asks for an exact match. Leave it out and MATCH assumes a sorted list, which can return the wrong position.
How do I look up a row and a column at once?
Use one MATCH for the row and one for the column: =INDEX(.
Does INDEX MATCH work in Google Sheets?
Yes, in exactly the same way.