Start free
Lookup & reference

MATCH function

MATCH tells you where a value sits in a list: its position, not the value itself. MATCH("A-104", A2:A6, 0) returns 4 because A-104 is the 4th item.

Available in every version of Excel, Excel for the web and Google Sheets
On this page

MATCH syntax

=MATCH(lookup_value, lookup_array, [match_type])
ArgumentRequiredWhat it means
lookup_valueYesWhat you're looking for.
lookup_arrayYesA single row or column to search.
match_typeNo0 for an exact match. 1 (the default) and -1 are approximate matches that need sorted data.

Examples

Where is a code in the list?

A-104 is the 4th code in A2:A6, so MATCH returns 4.

E2=MATCH(D2,A2:A6,0)
RowABCDE
1CodeProductFindPosition
2A-101KeyboardA-1044
3A-102Mouse
4A-103Monitor
5A-104Webcam
6A-105Headset
=MATCH(D2,A2:A6,0) → 4

Find a month's column in a header row

MATCH works across a row too. Mar is the 3rd month in B1:E1, so MATCH returns 3, ready to give INDEX as a column number.

B5=MATCH(B4,B1:E1,0)
RowABCDE
1RegionJanFebMarApr
2East120135150160
3
4MonthMar
5Column3
=MATCH(B4,B1:E1,0) → 3

Common mistakes

  1. Leaving out the 0. MATCH's default is an approximate match on sorted data. For codes and names, always write 0.
  2. Expecting the value instead of its position. MATCH returns a number such as 4. To get what's on that row, wrap it in INDEX.
  3. Searching a whole table. lookup_array must be one row or one column. MATCH(E2,A2:C6,0) returns #N/A.

FAQ

What does the 0 in MATCH mean?

It asks for an exact match. 1 finds the largest value less than or equal to the one you're looking for, and -1 the smallest value greater than or equal to it; both need sorted data.

Is MATCH case-sensitive?

No. "webcam" and "Webcam" match.

Guides that use MATCH

Worked problems with practice sheets.

Interview prepPractice sheet

Excel lookup interview question: match two tables

The lookup task almost every Excel interview includes: bring a value across from a second table. The answer interviewers want, why VLOOKUP fails here, and a sheet that grades yours.

4 min read · Updated
Errors & fixesPractice sheet

#N/A error in Excel: what it means and how to fix it

#N/A means a lookup didn't find what it was looking for. Here are the six usual causes, how to spot each one on the sheet, and the fix, with a practice sheet.

2 min read · Updated

Know MATCH? Prove it on a real sheet.

Practise MATCH and the functions around it in a live grid that grades your result and explains your mistakes.

Runs in your browser · Graded on your result · No install