MATCH

General lookup.

Syntax:

MATCH(key, lookup:array, lookup_type:number)

Looks up key in the lookup array or range of cells using lookup_type and returns the position in that array; if the lookup parameter specifies a range, MATCH returns the cell reference of the value found.

lookup_type MATCH action
-1MATCH finds the largest value which is less than or equal to key. Note that in this case, the lookup array must be sorted in ascending order.
0MATCH finds the value which exactly matches key.
1MATCH finds the smallest value which is greater than or equal to key. Note that in this case, lookup array must be sorted in descending order.

Example:

MATCH(2.5, {1,2,3}, 1)

returns 2.