The XMATCH function

Returns the position of a value in a range, like MATCH but with exact match as the default and search from the end.

Syntax

XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])
lookup_value
The value to find.
lookup_array
The range to search.
match_mode (optional)
0 exact (default), -1 exact or next smaller, 1 exact or next larger, 2 wildcards.
search_mode (optional)
1 first to last (default), -1 last to first.

Examples

D1=XMATCH("Plum",A2:A4)
ABCD
1FruitPrice3
2Apple4
3Pear6
4Plum5

In plain words: Find the position of Plum in the fruit list in A2:A4.

D1=XMATCH(6,B2:B4)
ABCD
1FruitPrice2
2Apple4
3Pear6
4Plum5

Read the guide

Related functions