MATCH
Returns the position of the item/lookup_value in the lookup_array or range.
Syntax
MATCH(lookup_value, lookup_array, [match_type])
Arguments
| Argument |
Description |
Required |
lookup_value |
The value to match in the lookup_array. |
Required |
lookup_array |
The data array that is being searched. |
Required |
match_type |
[OPTIONAL - defaults to 1] It can be set to 1, 0, or -1 to return results as given below: |
|
- If type is 1, then it will search for the next smallest or equal to the lookup_value. lookup_array must be in ascending order.
- If type is 0, then it will search for the exact match.
- If type is -1, then it will search for the next largest or the exact match to the lookup_value. lookup_array must be in descending order. | Optional |
Examples
Find exact position of value
=MATCH("Cherry", A1:A4, 0)
Result ⇒
3
Find position in sorted numeric list
=MATCH(25, A1:A5, 1)
Result ⇒
2
Find position of employee name
=MATCH("Bob", A1:A4, 0)
Result ⇒
3
Related Functions
Other Data functions:
- CHOOSE - Uses index to return a value from the list of value arguments
- COLUMN - Returns the column number of the current cell context.
- DROP - Drops the first N rows and optionally first N columns from an array. Returns an error if the result would be empty.
- FILTER - Returns a filtered array containing only rows that match the criteria
- GROUPBY - Groups data by a key and applies an aggregator function to each group
- HLOOKUP - Returns the corresponding value from the specified row of table which matches exactly or approximately to the first row of the table.
- HSTACK - Horizontally stacks arrays by appending columns
- INDEX - Returns a cell value from a list or table based on its column and row numbers.
- LAST - Returns the last N rows and optionally last N columns from an array. Returns an error if the result would be empty.
- MAP - Processes each row in an array with a formula including a COL or CELL keyword and returns it as a 2D array.
- PICK - Selects specific columns from an array using column numbers or header names
- ROW - Returns the 1-indexed row number of the current cell
- SEQUENCE - Returns the list of generated sequential numbers in an array.
- SORT - Sorts the values in a range or array.
- TAKE - Returns the first N rows and optionally first N columns from an array. Returns an error if the result would be empty.
- TRANSPOSE - Returns the result after transposing the rows and columns of an array or range.
- UNIQUE - Returns a list of unique values in a list or range.
- VLOOKUP - Returns a value from a table by looking up a value in the first column and returning a value from the specified column
- VSTACK - Vertically stacks arrays by appending rows
← Back to Formula Reference