LocalExcelTool
Get started

Excel MATCH function

MATCH does not return a value, it returns a position. Alone that is rarely useful, but as the row or column feeding INDEX (or anything else) it enables lookups in any direction. It is also the fastest "is this value in the list" test: ISNUMBER(MATCH(...)) beats COUNTIF on long lists.

Lookup & reference · Available in: Excel 97 and every desktop version since

Syntax

MATCH(lookup_value, lookup_array, [match_type])

What it returns The position of the value inside the range — a number, or #N/A when it is not there.

Arguments
lookup_valuerequiredThe value to find.
lookup_arrayrequiredA one-dimensional range only; a two-dimensional range returns #N/A.
match_typeoptional0 exact; 1 or omitted returns the largest value not exceeding the lookup value (sorted ascending); -1 returns the smallest value not less than it (sorted descending).

Examples

Position of a region in a list

Region
North
South
West
= MATCH("South",A2:A4,0)

→ 2

0 means exact, and the answer is "the second item in the range", which is worksheet row 3. That offset is the usual source of confusion: MATCH counts the range, not the sheet.

Test whether a value is in a list

Region
North
South
West
= ISNUMBER(MATCH("East",A2:A4,0))

→ FALSE

MATCH returns #N/A when the value is absent, ISNUMBER turns that into FALSE, and the whole thing drops straight into an IF. It scans the list once instead of twice, which matters on tens of thousands of rows.

Common mistakes

  • 1.Leaving the third argument out, or writing 1. The default is approximate, so an unsorted list returns a plausible-looking wrong position with no error — exact lookups must pass 0.
  • 2.Passing a two-dimensional range. MATCH takes one row or one column; A1:D10 gives #N/A, not the top-left cell.
  • 3.Assuming case matters — text matching ignores it, so "north" matches "North". Use EXACT or FIND when it does.
  • 4.Wildcards are active: * and ? in the lookup value are treated as wildcards, so a literal asterisk has to be written ~*.

How to use it

  1. 1.Click the cell where the result should appear.
  2. 2.Type = then the function name, and press Tab to accept it.
  3. 3.Enter each argument separated by commas; ranges can be dragged with the mouse.
  4. 4.Press Enter. Drag the fill handle down if the same formula applies to more rows.

Frequently asked questions

What is the syntax of MATCH?

MATCH(lookup_value, lookup_array, [match_type]). What it returns: The position of the value inside the range — a number, or #N/A when it is not there.

Which Excel versions support MATCH?

Excel 97 and every desktop version since. It is available in every desktop version unless the note above says otherwise.

Why does MATCH return an error instead of a value?

Leaving the third argument out, or writing 1. The default is approximate, so an unsorted list returns a plausible-looking wrong position with no error — exact lookups must pass 0.

Related functions

More in this group

Need to get the data in first?

← All Excel formulas