MATCH
About this lesson
MATCH searches a range for a value and returns its position in that range, as a number.
- find where a value sits in a list with MATCH.
- read the value to find from a cell rather than typing it.
- say why the range you give MATCH changes the number it returns.
The idea
It answers the question INDEX needs to ask. The third argument is the match type. It should almost always be 0, which means exact. Leave it off and MATCH assumes the range is sorted. It returns the position of the largest value that is still below what you asked for. On an unsorted list that is a number that means nothing.
The other trap is quieter. The position is counted from the start of the range you gave. Include a heading row and every answer moves by one. That is fine, as long as the INDEX that uses the number was given the same range.
The mistake to watch for
Leaving off the third argument. Without the 0, MATCH assumes the range is sorted. It returns the position of the largest value still below what you asked for. On an unsorted list, that number means nothing. Write the 0. And give INDEX a range that starts on the same row.
Where this comes up again
This lesson needs JavaScript to run. Everything below is the lesson in full, but you cannot type into the grid or be marked.
MATCH searches a range for a value and returns its position as a number.
In E2, type =MATCH("Cara",A2:A6,0).
Cara is what to find. A2:A6 is the runners. 0 means the match must be exact.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | Runner | Time | |||||
| 2 | Adeola | 41 | Elsa | ||||
| 3 | Bruno | 38 | |||||
| 4 | Cara | 45 | |||||
| 5 | Dimitri | 36 | |||||
| 6 | Elsa | 43 | |||||
| 7 | |||||||
| 8 |
Every step
-
MATCHsearches a range for a value and returns its position as a number. InE2, type=MATCH("Cara",A2:A6,0). Cara is what to find.A2:A6is the runners. 0 means the match must be exact. -
MATCHsearches numbers just as well. Read=MATCH(36,B2:B6,0)and say what it returns. -
The value can come from a cell.
D2holds a runner's name. InE4, find that runner's position inA2:A6, reading the name from the cell. -
The position is counted from the start of the range you give. Read
=MATCH("Cara",A1:A6,0), this time with the heading included, and say what it returns. -
In
E6, write a formula withMATCHthat gives the position of the slowest time, 45, in the times column. -
One thing about text. Read
=MATCH("cara",A2:A6,0), the name typed in lower case, and say what it returns.