ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 45 · INDEX and MATCH

Two-way lookup in Excel

A two-way lookup finds the value where a row and a column meet, like a student’s score in one subject. One MATCH finds the row, another finds the column, and INDEX gets the value.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Find the row with one MATCH
  • Find the column with another MATCH
  • Combine them in INDEX

How it works

=INDEX(B2:D6, MATCH(G2,A2:A6,0), MATCH(G3,B1:D1,0))

The first MATCH finds the student's row. The second finds the subject's column.

Formulas at a glance

=INDEX(table, MATCH(row…), MATCH(col…))The pattern to follow

Example

Write the formula to find the score for the student in G2 and the subject in G3.

ABCDEFG
1StudentMathScienceReading
2Ana887992StudentCleo
3Ben758481SubjectScience
4Cleo959189Score
5Dev627070
6Eli818877StudentBen

Click G4 and type =INDEX(B2:D6,MATCH(G2,A2:A6,0),MATCH(G3,B1:D1,0)), then press Enter.

The answer is 91.

When to use it

  • Score for a student and a subject
  • Price for a size and a color
  • Any grid with labels down the side and across the top

Common mistakes

  • Mixing up row and columnThe row MATCH comes first, then the column MATCH.
  • Including the labels in the INDEX tableINDEX uses only the numbers, like B2:D6.
  • Leaving out the 0sBoth MATCH functions need 0 for an exact match.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

Two-way lookup in Excel: how it works, with examples · ExcelUnpack