XMATCH Function
Return the relative position of a value in a row, column or array. lookup_value is the value to find and lookup_array where to search. match_mode is 0 for an exact match (the default), -1 for the next smaller item, 1 for the next larger item or 2 for a wildcard match; another mode returns #VALUE!. search_mode is 1 to search from the first item (the default), -1 from the last, and 2 or -2 for a binary search of sorted data. A value that is not found returns #N/A.
Syntax
XMATCH(lookup_value, lookup_array, match_mode, search_mode)
Category: Lookup. Minimum arguments: 2. Maximum arguments: 4.
Available for supported offline calculation.
Examples
=XMATCH(3,{1,2,3},0)
The formula returns 3, the position of 3 in the array.
Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.