Excel function

MATCHfunction

Returns the position of a value within a range.

All versions
=MATCH("P004", A2:A9, 0)
12345678
A
B
C
D
1
2
3
4
5
6
7
8
9

Click a cell to change lookup_value. Drag the corner dots to change lookup_array. Move lookup_array to column B and type "Eg*". The wildcard finds the position of Eggs. Try breaking it on purpose to see the errors.

Result

4

lookup_value

The value whose position you want.

lookup_array
A2:A9Drag a corner dot up/down to resize, sideways to change the column

The single row or column to search.

match_type

0 exact, 1 largest value ≤ lookup_value (ascending), -1 smallest value ≥ lookup_value (descending).

What is the MATCH function?

=MATCH(lookup_value, lookup_array, [match_type])

MATCH tells you where a value is: which position it has inside a range. It returns a number such as 4, not the value itself.

That position is exactly what INDEX needs, which is why the two are so often used together as INDEX/MATCH.

If you leave out match_type, MATCH uses 1 (approximate). Type 0 for an exact match.

Arguments

lookup_value
The value to find. With match_type 0 you can use wildcards: * for any characters, ? for one character.
lookup_array
A single row or column to search.
match_type
0 exact match. 1 (default) the largest value less than or equal to lookup_value; the range must be ascending. -1 the smallest value greater than or equal to lookup_value; the range must be descending.

MATCH examples

  1. Example 1. Position of a product code

    =MATCH("P004", A2:A9, 0)

    P004 is the 4th item of the range, so the result is 4.

  2. Example 2. With a wildcard

    =MATCH("Eg*", B2:B9, 0)

    Finds the first name starting with "Eg". The result is 4.

Common mistakes

FAQ

Does MATCH care about upper and lower case?
No. "eggs" and "Eggs" match.