MATCH function in Google Sheets
Returns the relative position of an item in a range that matches a specified value.
=MATCH(search_key, range, [search_type])MATCH syntax and parameters
Three arguments, two required.
- search_keyanyRequired
The value to search for. For example, 42, "Cats", or I24.
- rangerangeRequired
The one-dimensional array to be searched. If a range with both height and width greater than 1 is used, MATCH will return #N/A!.
- search_typenumberOptional
[ OPTIONAL - 1 by default ] - The manner in which to search. 1, the default, causes MATCH to assume that the range is sorted in ascending order and return the largest value less than or equal to search_key. 0 indicates exact match, and is required in situations where range is not sorted. -1 causes MATCH to assume that the range is sorted in descending order and return the smallest value greater than or equal to search_key.
MATCH examples
Formulas you'll actually reuse.
The row position of a customer — 0 means exact match:
=MATCH("Acme Corp", A2:A200, 0)Result
17Which tier band a spend amount falls in — type 1 needs ascending thresholds:
=MATCH(B2, {0, 1000, 5000, 20000}, 1)Result
3
MATCH in Excel
Same name — your formula ports as-is.
Try MATCH in the playground
Edit the example — nothing to install.
Preloaded with the MATCH formula from Example 1 — change anything and watch it respond.
MATCH errors
What they mean — and the fixes.
#N/ANo match — with type 0 the value must match exactly; TRIM stray spaces, and check that numbers aren't stored as text on one side.
Related functions
More ways Google Sheets gets this done.
- ADDRESSReturns a cell reference as a string.LookupExcel
- CHOOSEReturns an element from a list of choices based on index.LookupExcel
- COLUMNReturns the column number of a specified cell, with `A=1`.LookupExcel
- COLUMNSReturns the number of columns in a specified array or range.LookupExcel
- FORMULATEXTReturns the formula as a string. .LookupExcel
- GETPIVOTDATAExtracts an aggregated value from a pivot table that corresponds to the specified row and column headings.LookupExcel