Returns the relative position of an item in an array or range of cells.
Sintassi
XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])Argomenti
lookup_valueobbligatorio
The value you want to find.
lookup_arrayobbligatorio
La matrice o l'intervallo in cui cercare.
match_modefacoltativo
Specifies the match type: 0 (exact), -1 (exact or next smaller), 1 (exact or next larger), or 2 (wildcard).
search_modefacoltativo
Specifies the search order: 1 (first to last) or -1 (last to first).
XMATCH searches for a specified value in an array or range and returns the relative position of the item. It is a more flexible and robust successor to the MATCH function, supporting exact matches, wildcards, and binary searches.
=XMATCH("Apple", A1:A5)→2Returns the position of 'Apple' in the range A1:A5.
Select the cell
Click on the cell where you want to display the result.
Enter the formula
Type =XMATCH( and provide the lookup value and the array to search.
Configure optional modes
Add match_mode and search_mode arguments if you need specific search behavior.
XMATCH supports searching from the last item to the first and offers more flexible match modes without requiring sorted data.