XMATCH function - Zoho Sheet - Help Guide

XMATCH

Returns the relative position of the given value in a given range. XMATCH is an advanced version of the MATCH function.

 

Syntax

 

XMATCH(search_item; search_region; [match_mode]; [search_mode])

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.

-2 - Perform a binary search with the search_region sorted in descending 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


Get a hands-on experience of the function in the embedded range below.   



Possible Errors

 

Errors

Meaning

#N/A!

  • The function could not find the value it was asked to look for. Commonly occurs in VLOOKUP and similar functions.

#NAME!

  • The function name is incorrect or invalid.

  • The given defined name (if any) is invalid.

  • There is a typo in the defined name used in the function.

  • Double quotes are missing for text values in the function.

  • Colon missing in a cell range reference.

#VALUE!

  • The given argument's data type is incorrect or invalid.
    For example, the function =DATE(A1:A3) will return a #VALUE error when a text value is present in the range.

#REF!

  • The given cell reference is incorrect or invalid. This error may occur when a cell/range has been deleted, moved, or pasted over.

 

Similar Functions