Hands-On Excel

Hands-On Excel Challenges MATCH

Excel MATCH function practice

=MATCH(D2, $A$2:$A$9, 0) returns the position of D2 in the list: 1 for the first name, 7 for the seventh. The 0 asks for an exact match. On a list that isn't sorted, you always need it.

CoreAbout 3 minutesFree, no sign-upBy Updated

Try it yourself

20 · MATCH · Core

Where is it in the list?

The runners are listed in the order they finished. In E2:E4, find the place of each runner named in column D, then fill down. Change a name in D to test it.

MATCH(what, where, 0) gives the position of a value in a list: 1 for the first cell, 2 for the second. The 0 at the end means "exact match". Lock the list with $ before you fill down.

race.xlsx
Ready

Write in the green cells, then press Check. Click a cell while typing to insert it, drag to select a range, F4 adds $, Esc cancels.

The guide · MATCH

What MATCH returns

MATCH doesn't return a value from the list. It returns where the value is: a number counted from the top of the range. In a list of runners written in finishing order, that position is the place each one finished.

Syntax

=MATCH(lookup_value, lookup_array, [match_type])

Worked example

A2:A9 holds Priya, Omar, Lena, Tariq, Mei, Jonas, Sofia and Luca, in the order they finished. =MATCH("Sofia", A2:A9, 0) returns 7: Sofia is the 7th name in the range, so Sofia came 7th. The count starts at the top of the range, not at row 1 of the sheet. Sofia is on row 8, but the range starts on row 2.

Why the 0 matters

Leave the third argument out and MATCH does an approximate match. It assumes the list is sorted from smallest to largest, A to Z for text, and searches it quickly: it checks the middle, throws away the half the value can't be in, and repeats. On a list that isn't sorted, it can throw away the half with your value in it. You get a wrong position or #N/A, with no warning. On the race list, =MATCH("Sofia", A2:A9) returns 3.

match_typeFindsThe list must be
0exactly the same valuein any order
1 or left outthe largest value that is less than or equalsorted small to large
-1the smallest value that is greater than or equalsorted large to small

What MATCH is good for

On its own: places and ranks, checking whether something is on a list with =ISNUMBER(MATCH(D2, A2:A9, 0)), or finding which column a heading is in. Inside INDEX it becomes a lookup that works in any direction: that's the next challenge, INDEX and MATCH.

Common mistakes

FAQ

What does the MATCH function do in Excel?
It returns the position of a value in a range. =MATCH("Sofia",A2:A9,0) returns 7 when Sofia is the 7th cell of A2:A9.
What does 0 mean in MATCH?
It asks for an exact match. Without it, MATCH assumes the list is sorted and can return a wrong position, or #N/A, on a list that isn't.
Why does MATCH return #N/A?
With 0, the value isn't in the range: check the spelling and look for extra spaces. Without 0, the list may not be sorted, and the search skipped past the value.
Is MATCH case-sensitive?
No. "sofia" and "Sofia" match the same cell.
What is the difference between MATCH and XMATCH?
XMATCH, in Excel 365 and 2021 or later, does an exact match by default. MATCH works in every version of Excel but needs the 0.

All challenges

  1. 01 Add it upSUM Starter · 3 min
  2. 02 Find the averageAVERAGE Starter · 3 min
  3. 03 Write once, fill downRelative references Starter · 3 min
  4. 04 Lock it with $Absolute references Core · 3 min
  5. 05 Lock just the row or the columnMixed references Advanced · 3 min
  6. 06 Percent of a totalPercentages Starter · 3 min
  7. 07 Up or down by how much?Percent change Core · 3 min
  8. 08 Select to the end in one moveCtrl + Shift + arrow Core · 3 min
  9. 09 Pass or fail?IF Core · 3 min
  10. 10 Both or either?AND, OR Core · 3 min
  11. 11 Grade bands with nested IFNested IF Core · 3 min
  12. 12 Count the ones that matchCOUNTIF Core · 3 min
  13. 13 Add up the ones that matchSUMIF Core · 3 min
  14. 14 Use a cell as the conditionCriteria in a cell Core · 3 min
  15. 15 Count with two conditionsCOUNTIFS Core · 3 min
  16. 16 Add up with two conditionsSUMIFS Core · 3 min
  17. 17 Look it upVLOOKUP Core · 3 min
  18. 18 Find the right bracketVLOOKUP approximate match Core · 3 min
  19. 19 XLOOKUP, the modern wayXLOOKUP Core · 3 min
  20. 20 Where is it in the list?MATCH Core · 3 min
  21. 21 INDEX and MATCH togetherINDEX + MATCH Advanced · 3 min
  22. 22 Catch the error, not the bugIFERROR Core · 3 min
  23. 23 Split first and last namesLEFT, MID + FIND Core · 3 min
  24. 24 Mistake hunt: #N/A everywhereFixing #N/A Core · 3 min
  25. 25 Mistake hunt: hard-coded numbersReferences instead of typed numbers Core · 3 min
  26. 26 Mistake hunt: numbers stored as textNumbers stored as text Core · 3 min

Pro · coming soon

From first formula to job-ready.

100+ challenges on lookups, pivot tables, dates and text cleanup, an interview track modeled on the Excel tests employers use, and your progress saved across devices.

$29 one-time · early-bird price

You won't be charged today.

You're early!

Pro isn't open yet. We're building it right now. Leave your email and we'll hold the $29 early-bird price for you and tell you the day it launches.

We'll email you a link to confirm, then one email when Pro launches. Privacy