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
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.
Example 2. With a wildcard
=MATCH("Eg*", B2:B9, 0)Finds the first name starting with "Eg". The result is 4.
Common mistakes
Leaving out match_type
The default is 1, an approximate match on sorted data. On unsorted data it can return a wrong position without an error.
Expecting the value
MATCH returns a position. Wrap it in INDEX to get the value.
FAQ
- Does MATCH care about upper and lower case?
- No. "eggs" and "Eggs" match.