The XLOOKUP function offers a nice way to retrieve data from a range or an array from Excel; it’s a modern alternative for both HLOOKUP and VLOOKUP. It introduces advanced capabilities and significantly enhances user experience. This overview aims to explore the basics of utilizing XLOOKUP, highlight its benefits, and provide concrete examples to demonstrate how to harness its capabilities effectively.
The basic syntax for the XLOOKUP:
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
Here is a breakdown of each argument:
*'
for any number of characters and ‘?'
for any single character)Here are the practical examples of XLOOKUP:
Suppose you have a list of products and their prices in columns A and B, respectively. You want to find the price of a specific product.
Here is the Excel data:
To find the price of “Banana,” here’s the XLOOKUP formula:
=XLOOKUP("Banana", A2:A4, B2:B4)
If the lookup value is not found, you can specify a custom message, here’s the XLOOKUP formula:
=XLOOKUP("Orange", A2:A4, B2:B4, "Product not found")
To search for a product that starts with “Ch”, here’s the XLOOKUP formula:
=XLOOKUP("Ch*", A2:A4, B2:B4, "Product not found", 2)
If your data is sorted in descending order and you want to perform a binary search, here’s the XLOOKUP formula:
=XLOOKUP("Banana", A2:A4, B2:B4, "Product not found", 0, -2)
Also read: Microsoft Excel for Data Analysis
The XLOOKUP function represents a major improvement over conventional lookup functions in Excel. Its superior flexibility, robust error handling, and advanced search features make it an essential tool for data analysis and manipulation. Mastering XLOOKUP allows you to optimize your workflows and efficiently manage intricate lookup tasks.
Ans. XLOOKUP offers greater adaptability and features than VLOOKUP. It supports both vertical and horizontal lookups, eliminates the need for a column index number, and provides enhanced error handling and search capabilities.
Ans. The XLOOKUP can replace both HLOOKUP and VLOOKUP since it can search for and return values in both vertical and horizontal ranges.
Ans. To use wildcards, set the [match_mode] argument to 2. The ‘*’ symbol matches any sequence of characters, and the ‘?’ symbol matches any single character.
Ans. XLOOKUP is present in Excel for Microsoft 365, Excel 2019, and Excel for the web. It is not found in earlier versions of Excel.