Excel - XLOOKUP Function



XLOOKUP Function

The Excel XLOOKUP function assists users in looking at the value in one column and extracting the value from different columns based on a specific condition. XLOOKUP is a better alternative to VLOOKUP and is exclusive to Excel 365.

It is one of the most efficient techniques for error values and flexibility. This fantastic feature is enhanced to manage data and deal with errors. The significant advantages of XLOOKUP are its improved efficiency, accuracy, and straightforward formula.

Compatibility

The XLOOKUP function is compatible with the following versions of MS Excel −

  • Excel 365
  • Excel 2021
  • Excel for the web
  • Excel 2024

Syntax

The syntax of the XLOOKUP function is as follows −

=XLOOKUP(lookup_value, lookup_array, return_array, 
   [if_not_found], [match_mode], [search_mode]) 

Arguments

You can use the following arguments with the XLOOKUP function −

Argument Description Required / Optional
lookup_value A value to be searched within the defined array. Required
lookup_array It specifies an array from where you wish to search. Required
return_array A cell range or the array that is retrieved. Required
[if_not_found] A text string is displayed when no match is obtained from the array. Optional
[match_mode] It indicates the match type, such as an exact or wildcard match. Its value can be 0, -1, 1, or 2. Optional
[search_mode] It represents the mode of search whose value can be 1, -1, 2, and -2. Optional

Types of match_mode

A description of the various types of match modes are given below −

  • 0 It retrieves the Exact match; if you do not obtain the exact match, then the #N/A error will be retrieved.
  • -1 It also retrieves the exact match. However, if not searched, the next smaller value will be retrieved.
  • 1 It also denotes the exact match. If not found, then the next smaller value will be obtained.
  • 2 It indicates the wildcards match like ?*, etc.

Types of search_mode

Various types of search modes are given below −

  • 1 Search begins from the first item of the array. By default, this search mode is being used.
  • -1 Search begins from the reverse side of the array.
  • 2 It conducts a binary search in ascending order.
  • -2 It conducts a binary search in descending order.

XLOOKUP Function in Excel

The XLOOKUP function is not available in older versions of Microsoft Excel. If you try executing the XLOOKUP function in older versions, the inbuilt option is not populated in the cell. It is available in the latest versions, such as Excel 365, Excel 2024, etc.

Examples of XLOOKUP Function

Practice the following example to learn the use of the XLOOKUP function in Excel.

Example 1

The XLOOKUP function in Excel is used to searching and retrieving data from a range or array.

Solution

Step 1 − Open the worksheet comprising the two tables separately and write the following data as given below −

XLOOKUP Function in Excel

Step 2 − The main goal of this example is to find the designation of Dennis employee. Enter the formula =XLOOKUP(D3,Table3[Employee Name],Table3[Designation]) in the E3 cell.

XLOOKUP Function in Exce l

Step 3 − Then press the Enter tab. Therefore, the result is displayed in the E3 cell.

XLOOKUP Function in Excel 2

Example 2: Nested XLOOKUP in EXCEL

A nested XLOOKUP function can be useful when you need to perform multiple lookups in a single formula.

Solution

Step 1 − Create an interactive table in the range A1:D7 and fill out the proper data in the image below. Write the text in the ranges F2:F4 and G2:G3. Our main task is to find the maximum profit value in quarter 2 for an employee named David Joseph.

Nested XLOOKUP in EXCEL

Step 2 − Enter the formula =XLOOKUP(G3,Table3[Employee Name],XLOOKUP(H3,Table3[[#Headers],[Quarter 1]:[Quarter 3]],Table3[[Quarter 1]:[Quarter 3]])) in the I3cell.

Nested XLOOKUP in EXCEL 1

Explanation

  • G3 − The users must look at the value Sejal in the first column.
  • Table3[Employee Name] − The second argument denotes the first column of the table.
  • XLOOKUP(H3,Table3[[#Headers],[Quarter 1]:[Quarter 3]],Table3[[Quarter 1]:[Quarter 3]])) − The third argument defines the another XLOOKUP function where users have to look the G3 cells value in the table2 heading Table3[[#Headers],[Quarter 1]:[Quarter 3]] indicating ranges B1:D1 and extract the specified value from the range Table3[[Quarter 1]:[Quarter 3]])) representing the range B2:D7 indirectly.

Step 3 − Hence, the resulting value is obtained in the I3 cell, as highlighted in the image below. In the nested XLOOKUP, we search for the values specified in the G3 and H3 cells.

Nested XLOOKUP in EXCEL 1

XLOOKUP is one of the excellent techniques that overcome the limitations of the HLOOKUP and VLOOKUP functions. It enhances user productivity and streamlines users through the XLOOKUP function. Note that it is not available in the earlier version of Microsoft Excel. Users either need to install Office 365 or may use the web version of Office 365.

Download Practice Sheet

You can download and use the sample data sheet to practice the XLOOKUP function.

Advertisements