ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. INDEX MATCH MATCH: Two-Way Lookups Explained

INDEX MATCH MATCH: Two-Way Lookups Explained

By ExcelReady Team·Updated November 2, 2026·6 min read

The short answer

INDEX MATCH MATCH is a two-way lookup: =INDEX(B2:E6,MATCH(H1,A2:A6,0),MATCH(H2,B1:E1,0)). The first MATCH finds the row of the item in H1, the second finds the column of the heading in H2, and INDEX returns the value where they meet. It works in every Excel version and doesn't break when you insert columns.

Key takeaways

  • The pattern is =INDEX(data, MATCH(row item, row labels, 0), MATCH(column item, column headers, 0)).
  • The row labels must be the same height as the data, and the headers the same width.
  • Always use 0 as MATCH's last argument for an exact match.
  • In Excel 2021 or Microsoft 365, a nested XLOOKUP does the same job.
On this page+
  1. What INDEX MATCH MATCH does
  2. The three parts: INDEX, MATCH and MATCH
  3. How to write an INDEX MATCH MATCH formula
  4. How to line up the ranges
  5. How to fill the formula across a summary table
  6. Common INDEX MATCH MATCH errors
  7. The XLOOKUP alternative
  8. Practise it

INDEX MATCH MATCH is a two-way lookup: it finds the value where a row and a column meet, like the sales for East in Q3. One MATCH finds the row number, a second MATCH finds the column number, and INDEX returns the value at that crossing. This guide builds the formula step by step on a small sales grid, then covers the errors people hit most and the XLOOKUP alternative.

What INDEX MATCH MATCH does#

A normal lookup searches down one column. A two-way lookup searches down the rows and across the columns at the same time. You need it whenever your data is a grid, with labels down the side and headings across the top.

Here is the grid used in every example, quarterly sales by region in A1:E6:

ABCDE
1RegionQ1Q2Q3Q4
2North12,40013,85011,90015,200
3South9,80010,45012,10011,300
4East14,30012,90013,65016,000
5West8,7009,55010,2009,900
6Central11,10011,80012,50013,400

The question: what were the sales for the region in H1 (East) in the quarter in H2 (Q3)? Looking at the grid, the answer is 13,650. The formula should find it by itself.

The three parts: INDEX, MATCH and MATCH#

Each function does one simple job.

INDEX returns the value at a given position in a range:

Excel formula
=INDEX(array, row_num, [column_num])

=INDEX(B2:E6,3,3) returns the value in the 3rd row and 3rd column of B2:E6, which is 13,650. The INDEX function guide covers the details.

MATCH returns the position of a value in a list:

Excel formula
=MATCH(lookup_value, lookup_array, [match_type])

=MATCH("East",A2:A6,0) returns 3, because East is the 3rd item in A2:A6. =MATCH("Q3",B1:E1,0) also returns 3, because Q3 is the 3rd heading in B1:E1. The 0 means exact match. The MATCH function guide and the article on the MATCH function explain the other match types.

Put the two MATCHes where the 3s were, and you have the full formula.

How to write an INDEX MATCH MATCH formula#

Build it in three steps so each part is easy to check. In H3:

  1. Start with INDEX and the data only, without labels or headers: =INDEX(B2:E6,
  2. Add the row MATCH, looking up H1 in the region labels: MATCH(H1,A2:A6,0),
  3. Add the column MATCH, looking up H2 in the quarter headings: MATCH(H2,B1:E1,0))

The finished formula:

Excel formula
=INDEX(B2:E6,MATCH(H1,A2:A6,0),MATCH(H2,B1:E1,0))

The result is 13,650. Change H1 to West and H2 to Q1, and it returns 8,700 without any other edit. That is the real power: one formula answers every region and quarter question.

How to line up the ranges#

The formula only works if the three ranges line up with each other. This is the rule most people miss:

RangeExampleMust match
Data (INDEX)B2:E6—
Row labels (first MATCH)A2:A6Same rows as the data: 2 to 6
Column headers (second MATCH)B1:E1Same columns as the data: B to E

If the row labels started at A1, East would be in position 4, and INDEX would return row 4 of the data, which is West. The answer would be wrong with no error to warn you. When you write the formula, check that the first and last row and column numbers match across all three ranges.

How to fill the formula across a summary table#

Lock the ranges with $ and you can fill one formula across a whole report. Say you list regions in G6:G7 and quarters in H5:I5. In H6:

Excel formula
=INDEX($B$2:$E$6,MATCH($G6,$A$2:$A$6,0),MATCH(H$5,$B$1:$E$1,0))
  • $G6 locks the column, so every cell in the row reads its region from column G.
  • H$5 locks the row, so every cell in the column reads its quarter from row 5.

Fill right and down (Windows: Ctrl+R and Ctrl+D; Mac: ⌘R and ⌘D). Press F4 (Mac: ⌘T) while the cursor is in a reference to cycle through the $ options.

Common INDEX MATCH MATCH errors#

Most problems come from range sizes and exact matching.

  1. #N/A. A MATCH couldn't find its value. Check spelling, extra spaces ("Q3 " is not "Q3"), and numbers stored as text. Make sure both MATCHes end in 0.
  2. #REF! A MATCH returned a position outside the INDEX range. This happens when the header range is wider than the data, such as B1:F1 with data in B2:E6.
  3. A wrong value with no error. The label or header range is offset by one row or column. Re-check the alignment table above.
  4. Missing match type. Without the 0, MATCH assumes sorted data and can return a nearby item instead of the exact one.
  5. Ranges move when filled. Add $ signs, as shown above.

The guide to fixing INDEX MATCH when it's not working goes through each error in more detail.

The XLOOKUP alternative#

In Excel 2021 or Microsoft 365, you can do the same two-way lookup by putting one XLOOKUP inside another:

Excel formula
=XLOOKUP(H1,A2:A6,XLOOKUP(H2,B1:E1,B2:E6))

The inner XLOOKUP finds Q3 in the headers and returns the whole Q3 column, D2:D6. The outer XLOOKUP finds East in the region list and returns the matching value from that column: 13,650.

Which one should you use?

  • INDEX MATCH MATCH works in every version of Excel and is a classic interview and test question.
  • Nested XLOOKUP is easier to read and defaults to an exact match, but older Excel shows #NAME?.

For a full comparison, see INDEX MATCH vs XLOOKUP. If you're still choosing between lookups in general, VLOOKUP vs INDEX MATCH explains why INDEX MATCH is more flexible, and the guide to INDEX MATCH covers the one-way version.

Practise it#

Try the exercise on this page: write the formula in three steps and check that it returns 13,650. Then practise INDEX and MATCH in a live spreadsheet, and test yourself with the INDEX/MATCH skill check, where every formula is checked instantly.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Find the sales for the region in H1 and the quarter in H2. In H3, use INDEX with two MATCH functions on the data in B2:E6.

fx
ABCDEFGHI
1
Region
Q1
Q2
Q3
Q4
Region
East
2
North
12400
13850
11900
15200
Quarter
Q3
3
South
9800
10450
12100
11300
Sales
4
East
14300
12900
13650
16000
5
West
8700
9550
10200
9900
6
Central
11100
11800
12500
13400
7
8
9

Tip: INDEX(B2:E6, row, column). For the row, MATCH H1 in A2:A6. For the column, MATCH H2 in B1:E1. Use 0 in both MATCHes.

Practise this in a lesson

LessonINDEX and MATCHCombine INDEX and MATCH to look up in any direction, including returning a column to the left of the one you search.LessonINDEX/MATCH skill checkTest your INDEX and MATCH on a stock report: look up to the left, find the best-stocked item, and run two-way lookups across a monthly table.Function guideINDEXLearn the Excel INDEX function: return a value by row and column position, build two-way lookups with MATCH, and practice live.Function guideMATCHLearn how Excel's MATCH finds the position of a value, why the 0 matters, and how it powers INDEX/MATCH. Includes a live exercise.

Frequently asked questions

What is INDEX MATCH MATCH used for?

+

It finds a value in a grid by both its row and its column, such as the sales for East in Q3. One MATCH finds the row, the other finds the column, and INDEX returns the value at that crossing.

How do you write an INDEX MATCH MATCH formula?

+

Use =INDEX(data,MATCH(row_value,row_labels,0),MATCH(column_value,column_headers,0)). The data range must not include the labels or headers, and the label ranges must line up with it.

Why does my INDEX MATCH MATCH return #REF!?

+

One of the MATCH results is bigger than the INDEX range allows. This happens when the header range is wider, or the label range taller, than the data range. Make them the same size.

Why does INDEX MATCH MATCH return #N/A?

+

One MATCH couldn't find its value. Check spelling, extra spaces, numbers stored as text and that the last MATCH argument is 0. A heading like Q3 must match exactly.

Is XLOOKUP better than INDEX MATCH MATCH?

+

A nested XLOOKUP does the same two-way lookup and is easier to read, but it needs Excel 2021 or Microsoft 365. INDEX MATCH MATCH works in every version.

Sources

  • INDEX function - Microsoft Support
  • MATCH function - Microsoft Support
  • XLOOKUP function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What INDEX MATCH MATCH does
  2. The three parts: INDEX, MATCH and MATCH
  3. How to write an INDEX MATCH MATCH formula
  4. How to line up the ranges
  5. How to fill the formula across a summary table
  6. Common INDEX MATCH MATCH errors
  7. The XLOOKUP alternative
  8. Practise it

Keep reading

Lookups· 6 min read

INDEX MATCH in Excel: The Beginner's Guide

INDEX MATCH is a lookup built from two functions. MATCH finds the position of a value in one column, and INDEX returns the item at that position from another column: =INDEX(A2:A9,MATCH(G2,B2:B9,0)). It can look left, it keeps working when columns are inserted, and it runs in every version of Excel.

Errors & fixes· 6 min read

INDEX MATCH Not Working? 7 Causes and Fixes

INDEX MATCH usually fails because MATCH is missing its 0 for an exact match, the INDEX and MATCH ranges don't start on the same row, or the lookup value and the data don't match exactly (text vs numbers, extra spaces). Write it as =INDEX(C2:C7,MATCH(E2,A2:A7,0)), with both ranges the same size, and lock them with $ before copying.

Comparisons· 7 min read

VLOOKUP vs INDEX MATCH: Differences and When to Use Each

Use VLOOKUP for quick lookups to the right in a table that won't change shape. Use INDEX MATCH when you need to look left, when columns may be inserted, or when you want a two-way lookup. Both work in every version of Excel, so INDEX MATCH is the flexible choice when XLOOKUP isn't available.

More on lookups

  • INDIRECT Function in Excel: Build References From Text
  • How to Look Up a Value by Date in Excel
  • Find the Last Match in Excel With XLOOKUP
  • Lookup With Multiple Criteria in Excel
  • Return Every Match for a Lookup in Excel (FILTER)
  • How to Look Up to the Left in Excel
All lookups articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free