XLOOKUP function - Zoho Sheet - Help Guide

XLOOKUP

Tests the search_table for the given lookup_value and returns a corresponding value from the result_table. XLOOKUP is an advanced version of the VLOOKUP and HLOOKUP functions that searches both vertically and horizontally.

 

Syntax

 

XLOOKUP(lookup_value; search_table; result_table; [if_not_found]; [match_mode]; [search_mode])

lookup_value: The value to search for in the search_table. Eg., F3

search_table: Range with values to evaluate. Eg., C2:C13

result_table: Range that you want the corresponding value from as result. Eg., A2:B13

if_not_found: Text to be displayed when no valid match is found. Defaults to #N/A error if omitted. Eg., "Invalid Emp ID"

match_mode: Determines the type of match to perform. Defaults to 0, if omitted.

Supported match_mode:

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 lookup_value is searched in search_table. . Defaults to 1, if omitted.

Supported search_value:

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_table sorted in ascending order. If not sorted, invalid results will be returned.

-2 - Perform a binary search with the search_table sorted in descending order. If not sorted, invalid results will be returned.

 

Remarks

  • XLOOKUP can be used to bring corresponding data from other worksheets.

  • Use named ranges for  search_table  and  result_table . This helps refer a single source data table to create multiple tables for calculation and analysis.

  • 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

 

Formula

Result

=XLOOKUP(F3;C2:C13;A2:B13;"Invalid Emp Id")

Sarah Jones | 9/14/95

=XLOOKUP("Ben.*";A2:A13;C2:C13;"No result found";2)

4323

=XLOOKUP(I2;M$2:M$10;N$2:N$10)

Groceries


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