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.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Student | Math | Science | Reading | |||
| 2 | Ana | 88 | 79 | 92 | Student | Cleo | |
| 3 | Ben | 75 | 84 | 81 | Subject | Science | |
| 4 | Cleo | 95 | 91 | 89 | Score | ||
| 5 | Dev | 62 | 70 | 70 | |||
| 6 | Eli | 81 | 88 | 77 | Student | Ben |
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.