Returns the relative position of the given value in a given range. XMATCH is an advanced version of the MATCH function.
Syntax
search_item: The value to search for in the search_region. Eg., E2
search_region: The row/column to search. Eg., A2:A46
match_mode: Determines the type of match to perform. Defaults to 0, if omitted.
Supported Match_type
0 - The first exact match is considered.
-1 - The first exact match is considered. If none found, it returns the next smallest value.
1 - The first exact match is considered. If none found, it returns the next largest value.
2 - A regex match where .*, .?, and / have special meaning.
search_mode: Determines how search_item is searched in search_region. Defaults to 1, if omitted.
1 - Search from top to bottom in the given range.
-1 - Search from bottom to top in the given range.
2 - Perform a binary search with the search_region sorted in ascending order. If not sorted, invalid results will be returned.
Remarks
If you don't remember the complete text you have to search for, use .*, .? and / instead.
.* - Can be used to replace any number of characters. Eg.,
Zyl.*
finds
Zylker
.? - Can be used to replace a single character. Eg.,
Mar.?us
finds
Marcus
and
Markus
/ - Can be used to include *, ? and / in the search term. Eg., Zylker/* finds Zylker* and Mar.?us/? finds Marcus? and Markus?
Examples
|
F ormula |
Result |
|
=XMATCH(E2;A2:A46)-1 |
Abraham Lincoln |
Possible Errors
|
Errors |
Meaning |
|
#N/A! |
|
|
#NAME! |
|
|
#VALUE! |
|
|
#REF! |
|
Similar Functions