INDEX MATCH
INDEX and MATCH together form a lookup that works in every direction and every version. Learn both functions, combine them and practice with a rate table.
- Free, no sign-up
- No upload – files stay on your device
- Phone, tablet and computer
INDEX MATCH is the flexible way to look up values: MATCH finds the position of a value in a column, INDEX returns the entry at that position from another column. Together they look left or right, work in every Excel version and can even search a table by row and column at once. Practice above with an inventory list and a shipping rate table.
INDEX MATCH in two parts
MATCH: where is the value?
=MATCH(lookup_value, lookup_array, [match_type]) returns a number: the position of the value in the range. In the practice sheet, =MATCH(G2,B2:B11,0) returns 8, because item number 4426 is the 8th entry in B2:B11.
| match_type | Meaning |
|---|---|
0 |
Exact match; the list can be in any order |
1 |
Largest value less than or equal to the lookup value; list sorted ascending |
-1 |
Smallest value greater than or equal to the lookup value; list sorted descending |
INDEX: what’s at that position?
=INDEX(array, row_num, [column_num]) returns the cell at a given position. =INDEX(A2:A11,8) returns “Highlighter Set”. INDEX counts from the first cell of the range, so A2 is row 1.
Combining INDEX and MATCH
Put MATCH inside INDEX, and you have a lookup:
=INDEX(D2:D11,MATCH(G2,B2:B11,0))
MATCH finds the row of item 4426, INDEX returns the stock from that row: 64. The return range D2:D11 and the lookup range B2:B11 are independent of each other, so the result column can also be to the left of the search column.
Practice right here
Fill in the green cells and click Check. You learn the two functions separately first, then together:
- Find the position of an item number with MATCH.
- Return the item name at that position with INDEX.
- Combine both into one formula to return the stock.
- Look up a shipping rate by weight and zone in two directions.
Change the item number, weight or zone in the yellow cells afterwards, and every result updates.
Looking up by row and column
INDEX takes a row and a column number. With two MATCH functions, you can read a value from a grid, such as a rate table with weights down the side and zones across the top:
=INDEX(G10:I14,MATCH(G16,F10:F14,1),MATCH(G17,G9:I9,0))
The first MATCH uses match type 1 to find the weight tier (7.5 lbs falls into “from 5 lbs”), the second finds “Zone 2” exactly. The result is $13.90.
Common mistakes
- Missing 0 in MATCH: without it, MATCH assumes a sorted list and may return a wrong position.
- Off by one row: one range starts at the header (row 1), the other in row 2.
- #REF!: the row or column number is larger than the INDEX range.
- Row and column swapped: INDEX expects the row first, then the column.
If you only need a simple lookup and everyone uses a current version, XLOOKUP is shorter. In older workbooks you’ll often find VLOOKUP, which can only return columns to the right.
Frequently asked questions
Why use INDEX and MATCH instead of a single lookup function?
It works in every Excel version, can look in any direction, and doesn’t break when you insert a column between the lookup and result columns.
Can INDEX MATCH use several criteria?
Yes. The simplest way is a helper column that joins both values, for example =A2&"|"&C2, and a MATCH on that column with the joined lookup value. This works in Excel and in the Spreadsheet Editor alike.
Does MATCH return the value or the position?
The position. That’s why you need INDEX to get the actual value.
Microsoft Excel is a trademark of Microsoft Corporation. The Spreadsheet Editor is not affiliated with Microsoft.