intermediate 5 min read

Two-Way Lookup with INDEX MATCH in Google Sheets

Use INDEX MATCH MATCH for two-way lookups in Google Sheets. Find values at the intersection of a row and column with step-by-step examples.

SB

Sheets Bootcamp

March 5, 2026 · Updated November 6, 2026

Reviewed by Ryan

Quick Answer

Use INDEX with two MATCH functions, one for the row and one for the column: =INDEX(B2:E5, MATCH("Watson", A2:A5, 0), MATCH("Q3", B1:E1, 0)). The first MATCH finds Watson at row 2, the second finds Q3 at column 3, and INDEX returns $8,200 from that intersection. Keep the INDEX range to the table body, B2:E5, without the headers or row labels.

A two-way lookup in Google Sheets finds a value at the intersection of a specific row and column. Standard INDEX MATCH searches one column for a row position. Adding a second MATCH for the column position creates a two-dimensional lookup that works with cross-reference tables, schedules, and matrix-style data.

In This Guide

What Is a Two-Way Lookup?

A two-way lookup answers the question: “What value sits at this row and this column?” You provide two search keys: one to identify the row and one to identify the column.

This comes up with cross-reference tables where row labels and column headers both matter. A quarterly sales report has salesperson names down the side and quarter labels across the top. To find Watson’s Q3 sales, you need to match both the row (Watson) and the column (Q3).

Neither VLOOKUP nor standard INDEX MATCH can handle this in a single formula. VLOOKUP hardcodes the column index as a number. Standard INDEX MATCH finds the row but returns from a fixed column. INDEX MATCH MATCH solves both at once.

The INDEX MATCH MATCH Pattern

The formula uses INDEX with three arguments: a data range, a row number from the first MATCH, and a column number from the second MATCH.

Formula
=INDEX(data_range, MATCH(row_key, row_labels, 0), MATCH(col_key, col_headers, 0))
ComponentPurpose
data_rangeThe body of the table (no headers, no row labels)
MATCH(row_key, row_labels, 0)Finds the row position of the row search key
MATCH(col_key, col_headers, 0)Finds the column position of the column search key

The first MATCH searches vertically (down a column). The second MATCH searches horizontally (across a row). INDEX returns the cell at their intersection.

Try it yourself

Question 1 of 3

3 quick questions. No account needed.

In B11, return the count for the class in B9 on the day in B10. Use INDEX with two MATCHes, each with 0.

A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
12
13
Class
Mon
Wed
Fri
Barre
14
18
12
Spin
22
19
25
Pilates
9
11
13
Boxing
16
12
20
Zumba
27
24
30
Rowing
8
10
7
Class
Spin
Day
Fri
Count
B11

Two-Way Lookup: Step-by-Step

We’ll use a quarterly sales table to find a specific salesperson’s sales for a specific quarter.

Sample Data

The table has salesperson names in column A and quarterly totals in columns B through E (Q1 through Q4), with data in rows 2 through 5.

Quarterly sales table with salesperson names and Q1 through Q4 columns

1

Set up your cross-reference table

The table body (B2:E5) contains the sales values. Row labels (A2:A5) contain the salesperson names. Column headers (B1:E1) contain the quarter labels Q1 through Q4.

2

Write the row MATCH

Find Watson’s row position in the name column:

Formula
=MATCH("Watson", A2:A5, 0)

This returns 2 because Watson is the 2nd value in A2:A5.

3

Write the column MATCH

Find Q3’s column position in the header row:

Formula
=MATCH("Q3", B1:E1, 0)

This returns 3 because Q3 is the 3rd value in B1:E1.

4

Combine into INDEX MATCH MATCH

Formula
=INDEX(B2:E5, MATCH("Watson", A2:A5, 0), MATCH("Q3", B1:E1, 0))
  • First MATCH returns 2 (Watson’s row in the data range)
  • Second MATCH returns 3 (Q3’s column in the data range)
  • INDEX returns the value at row 2, column 3 of B2:E5, which is $8,200

INDEX MATCH MATCH formula returning $8,200 for Watson Q3

Important

INDEX and both MATCH ranges must start at the same row and column. The usual way is the data body B2:E5, with A2:A5 and B1:E1 for the MATCHes. If INDEX includes the headers (A1:E5), start both MATCH ranges at row 1 and column A too, or the positions point one cell off.

Practical Examples

Example 1: Find Lestrade’s Q1 Sales

Formula
=INDEX(B2:E5, MATCH("Lestrade", A2:A5, 0), MATCH("Q1", B1:E1, 0))

MATCH finds Lestrade at position 3 in A2:A5, Q1 at position 1 in B1:E1. INDEX returns $4,100 from row 3, column 1 of the data range.

Example 2: Find Sherlock’s Q4 Sales

Formula
=INDEX(B2:E5, MATCH("Sherlock", A2:A5, 0), MATCH("Q4", B1:E1, 0))

MATCH finds Sherlock at position 1, Q4 at position 4. INDEX returns $7,800 from row 1, column 4.

Example 3: Use with Product Inventory Data

The pattern works with any cross-reference layout. Using the product inventory, if you had a matrix of products by attribute, the formula structure stays the same.

To find a specific product’s stock from the standard inventory table, you could also write a two-way lookup with INDEX over a multi-column range:

Formula
=INDEX(A2:F9, MATCH("SKU-105", A2:A9, 0), MATCH("Stock", A1:F1, 0))

This returns 120, the stock count for SKU-105 (Cipher Decoder). The first MATCH finds SKU-105 at row position 5, the second MATCH finds “Stock” at column position 5 in the headers.

Two-way lookup on product inventory returning stock for SKU-105

Dynamic Two-Way Lookup

Replace hardcoded values with cell references to create a reusable lookup:

Formula
=INDEX(B2:E5, MATCH(G2, A2:A5, 0), MATCH(H2, B1:E1, 0))

Type a salesperson name in G2 and a quarter label in H2. The formula returns the matching sales figure. Pair this with data validation dropdowns to build an interactive dashboard.

Dynamic two-way lookup with cell references for row and column keys

Tip

Lock the ranges with absolute references when copying the formula: =INDEX($B$2:$E$5, MATCH(G2, $A$2:$A$5, 0), MATCH(H2, $B$1:$E$1, 0)). The cell references G2 and H2 stay relative.

Common Errors

#N/A: Search key not found

One or both MATCH functions cannot find the search key. Check spelling, extra spaces, and data types. “Q 3” (with a space) does not match “Q3”.

Fix: Verify the row label and column header exist exactly as typed. Use =TRIM() to remove whitespace.

#NUM!: Data range too small

The MATCH position exceeds the dimensions of the INDEX range. If MATCH returns row position 5 but the INDEX range has only 4 rows, you get #NUM!.

Fix: Make sure the INDEX data range covers all rows and columns. If the table has 4 salesperson rows (2 through 5), the data range should be B2:E5.

Wrong value: Headers included in data range

If the INDEX range includes the header row (B1:E5 instead of B2:E5), positions shift by one row. MATCH returns position 2 for Watson, but row 2 of B1:E5 is actually Sherlock’s data.

Fix: Start the INDEX range at the first data row, not the header row.

Warning

Both MATCH functions must use 0 for exact matching. The default (1) assumes sorted data and returns approximate matches, which produces wrong positions on unsorted row labels or column headers.

Tips

  1. Keep the data range clean. The INDEX range should cover only the table body. Row labels and column headers go in the MATCH ranges, not the INDEX range.

  2. Test each MATCH separately. Before writing the full formula, test =MATCH("Watson", A2:A5, 0) and =MATCH("Q3", B1:E1, 0) individually. Confirm both return the expected positions.

  3. Use IFERROR for missing combinations. =IFERROR(INDEX(..., MATCH(...), MATCH(...)), "Not found") handles cases where the row or column key does not exist.

  4. INDEX MATCH MATCH is the standard pattern. VLOOKUP alone cannot do a true two-way lookup. A nested XLOOKUP also works, but INDEX MATCH MATCH is the standard approach for matrix-style data.

Frequently Asked Questions

What is a two-way lookup in Google Sheets?
A two-way lookup finds a value at the intersection of a specific row and column. You provide both a row identifier and a column header, and the formula returns the cell where they meet. INDEX with two MATCH functions handles this.
Can VLOOKUP do a two-way lookup?
VLOOKUP alone cannot do a two-way lookup. You can nest MATCH inside the column index argument of VLOOKUP, but INDEX MATCH MATCH is the standard approach and easier to read.
What does INDEX MATCH MATCH mean?
INDEX MATCH MATCH is a formula pattern that uses INDEX with two MATCH functions. The first MATCH finds the row position, the second MATCH finds the column position, and INDEX returns the value at that intersection.
Why does my two-way lookup return the wrong value?
Check that both MATCH functions use 0 for exact matching. Also verify the row headers and column headers in your data match the search values exactly, including spelling and spacing.
Can XLOOKUP do a two-way lookup?
Yes. A nested XLOOKUP, where the inner XLOOKUP returns a block and the outer one picks from it, also does a two-way lookup. INDEX MATCH MATCH is more readable and widely used for this purpose.

You read about INDEX MATCH. Now type it.

Unit 1 of the course is free: 6 short lessons in a grid that checks every formula. They teach the Google Sheets skills you'll actually use.

Start the course free

First 6 lessons free. No card needed. See plans

Keep going

Continue learning

Unit 2 is next. Get full access

Practice this in the app

Practice INDEX MATCH

Spot an error on this page? Tell us.

First 6 lessons free. No credit card required.

Start the course free
Continue learning

Cookie policy · Privacy policy