The XLOOKUP function in Excel is a powerful and flexible tool designed to replace older lookup functions like VLOOKUP and HLOOKUP. Unlike these traditional functions, XLOOKUP can search both vertically and horizontally, making it ideal for retrieving specific values from any range in a table. With added benefits like default exact matching and the ability to handle errors more gracefully, XLOOKUP makes data retrieval in Excel easier and more reliable.
In this article, we will cover how XLOOKUP works, its syntax, and practical examples to help you make the most of this versatile function.

XLOOKUP Function in Excel With Examples
What is XLOOKUP in Excel
XLOOKUP is a powerful function in Excel designed to search for a specific value in a range and return a corresponding value from another range. It replaces older functions like VLOOKUP and HLOOKUP, addressing their limitations by allowing for more flexible searches, including reverse lookups and partial matches.
XLOOKUP Formula in Excel with Example
=XLOOKUP(lookup_value, lookup_array, return_array, [if _not_found], [match_mode], [search_mode])
=XLOOKUP(search for this value, in this range, and Return a match from this range).
Arguments Explained
- lookup_value: The value you want to search for.
- lookup_array: The range of cells where Excel will search for the lookup value.
- return_array: The range of cells from which to return the result.
- if_not_found (optional): Value to return if no match is found.
- match_mode (optional): Specifies the type of match (exact, approximate, or wildcard).
- search_mode (optional): Determines the search direction (first-to-last or last-to-first).
Match Type |
Behavior |
0 (default) |
Here it will look for an exact match |
-1 |
If we do not get the exact match then it will return the next smaller item. |
1 |
If we do not get the exact match then it will return the next larger item. |
2 |
It will do partial matching using (* or ~) |
- search_mode (Optional): where we can specify how the function should look up the value.
Search mode |
Behavior |
1(default) |
It will search the values first. |
-1 |
It will search the values in reverse from last. |
2 |
It will perform a binary search and data needs to be sorted in ascending order. |
-2 |
It will perform a binary search and data needs to be sorted in descending order. |
How to Enable XLOOKUP in Excel
To access the XLOOKUP function in Excel, you need to be using a version of Excel that supports it.
How to Enable XLOOKUP in Excel 365
XLOOKUP is included in Excel 365, which is a subscription-based version of Excel that receives regular updates and new features.
How to Enable XLOOKUP in Excel 2019
XLOOKUP was introduced in Excel 2019, which is a one-time purchase version of Excel. However, it might not be available in older versions of Excel, such as Excel 2016 or earlier.
Step-by-Step Guide to Using XLOOKUP in Excel
Step 1: Open Excel
Start by opening your Excel application and loading the worksheet containing your data.
Step 2: Select a Cell
Click on an empty cell where you want to display the result of your XLOOKUP function.
- Type
=XLOOKUP(
into the selected cell. Excel will prompt you with a list of arguments.
Step 4: Enter Required Arguments:
- lookup_value: Specify the value you are searching for (e.g., a cell reference like A2).
- lookup_array: Select the range where Excel should look for this value (e.g., B2:B10).
- return_array: Choose the range from which you want to retrieve data corresponding to the found value (e.g., C2:C10).
Example formula:
=XLOOKUP(A2, B2:B10, C2:C10)
Optional Arguments:
- If desired, add optional arguments such as
if_not_found
to handle cases where no match is found.
- Use
match_mode
to specify how closely you want Excel to match your lookup value (0 for exact match, 1 for next largest, etc.).
- Set
search_mode
if you want to control whether it searches from first to last or vice versa.
Close the parentheses and press Enter. Your formula should now return the corresponding value based on your criteria.
XLOOKUP Example in Excel: 6 Examples Explained
Below are some examples through which the XLOOKUP function will be easily understandable.
Example 1: Using XLOOKUP for Exact Matches
This function in XLOOKUP is by default. Follow the below steps to Lookup a value:

Enter you Data
Now, if we want to get the math marks of Carry then follow the next step
We will enter =XLOOKUP(E2, A2:A5, B2:B5) in the F2 cell to get the marks of carrying.

Enter the Formula
Then we will get the math marks for carry.
Example 2: How to Approximate Match in Excel
If you want to find the closest (approximate) match to a specified value, use match mode -1 (next smaller) or 1 (next larger):
Let’s consider the below example for Approximate match mode.

Format your Data
Formula used is : =XLOOKUP(lookup value, in this range, Return a value from this range, -1)
Here -1 will return the approximate value which is smaller than the lookup value.
Note: The user can also use 1 instead of -1 to return a value larger than the lookup value. The XLOOKUP function can also work for Unsorted data.
Example 3: How to Use Left Lookup in Excel
Unlike VLOOKUP, XLOOKUP can perform a left lookup, allowing you to search for values on the left side of the data:
Using INDEX and MATCH in Excel left lookup can be performed but to make it simple and quick you can also use the XLOOKUP function. This XLOOKUP function is used to search the values which are on the left side of the searched values.
The formula used: = XLOOKUP(Search for this value, from this range, and return the output from this range)
Here the output we are looking for will be from the left side of the column.
Example 4: How to Use XLOOKUP on Multiple Values
You can combine XLOOKUP with additional functions for more complex lookups. To retrieve a value based on multiple conditions, use concatenation or an array formula:

Enter and Format your Data
Now, if we want to get the Math and English marks for carrying then follow the next step
We will enter =XLOOKUP(E2,A2:A5,B2:C5) in F2 cell.

Enter the Formula
Step 3: Marks Obtained
Then we will get the Math and English marks.

Marks Obtained
Example 5: How to Use Nested XLOOKUP function in Excel
Follow the below steps to use nested XLOOKUP functions:
.webp)
Format your Data
Now, if we want to get the math marks of Carry by two-way lookup then follow the next step.
We will enter =XLOOKUP(F1,B1:C1,XLOOKUP(E2,A2:A5,B2:C5)) in F2 cell.
Here, XLOOKUP(E2, A2:A5, B2:C5) is{100,80} which is an array mark of Carry. In the outer XLOOKUP formula, we are looking for the subject name which is in the F1 cell and the lookup array is B1:C1.

Enter the Formula
Step 3: Marks Displayed
Then we will get the math marks of carry.

Marks Displayed
Example 6: How to Use Not Found in Excel
Follow the below steps when the LOOKUP function returns the Not Found message:

Format your Data
If we want the marks of Sunny who is not in the dataset
We will enter =XLOOKUP(E2,A2:A5,B2:B5,”Not Found”) in F2 cell.

Enter your Data
Step 3: Not Found Displayed
Then it will show Not Found.

Not Found Displayed
Example 4: How to Use SUM function in Excel
Follow the below steps to find the sum of a range:

Format your Data
If we want the total math marks from Harry to Jonny then do the next step
We will enter =SUM(XLOOKUP(E2,A2:A5,B1:B6):XLOOKUP(F2,A2:A5,B1:B6)) in G2 cell this simply means =SUM($B$2:$B$5).

Enter your Formula
Step 3: Sum Displayed
Then we will get the sum.

Sum Displayed
Example 5: How to Use Horizontal Lookup in Excel

Format your Data
Now, if we want to get the math marks of Carry then follow the next step
We will enter =XLOOKUP(B6,B1:E1,B2:E2) in B7 cell.

Format your Data
Step 3: Carry Marks Displayed
Then we will get the math marks of Carry

Carry Marks Obtained
Example 6: How to Use Last Match in Excel
Follow the below steps to use last match in Excel:
Step 1: Enter your data
By default, the XLOOKUP Function performs a top-to-bottom search. But if the user wants to change this order and search for the bottom to top then the formula should be: =XLOOKUP(Search for the value, in this range, return the output from this range, -1)
Note: -1 in this formula should be the 6th parameter)
XLOOKUP Vs VLOOKUP: Key Differences
XLOOKUP and VLOOKUP are Excel functions used for finding information in a table, but they have differences:
Feature |
XLOOKUP |
VLOOKUP |
Lookup Type |
More versatile, handles both vertical and horizontal lookups. |
Primarily for vertical lookups. |
Syntax |
Easier syntax, with no need to specify column numbers. |
Requires specifying column index, which can be cumbersome. |
Error Handling |
Built-in error handling with custom error messages. |
Basic error handling using the “IFERROR” function. |
Search Flexibility |
Supports wildcards for flexible searches. |
Defaults to exact matches; requires extra steps for approximate matches. |
Return Values |
Can return arrays of values. |
Returns a single value, not suitable for multiple matches. |
Dataset Compatibility |
Works well with large datasets and dynamic arrays. |
Limited to simpler tasks and smaller datasets. |
Overall |
More user-friendly and powerful, especially for complex tasks. |
Simpler but has limitations. |
Note: XLOOKUP is more versatile and user-friendly, especially for complex datasets and lookups across multiple columns or rows.
Advanced XLOOKUP Techniques
- Nested XLOOKUP: Use XLOOKUP within another XLOOKUP for two-way lookups.
- Horizontal Lookups: Perform searches across rows instead of columns.
- Using XLOOKUP for Summation: Calculate totals over a specified range using XLOOKUP with SUM.
Conclusion
In conclusion, XLOOKUP is a revolutionary addition to Excel that addresses the limitations of VLOOKUP and HLOOKUP. By mastering XLOOKUP, you can perform efficient data searches, streamline your workflow, and enhance your overall productivity. Whether you’re a financial analyst, data scientist, or small business owner, leveraging XLOOKUP in your daily tasks will save you valuable time and effort.
Similar Reads
XLOOKUP Function in Excel With Examples
The XLOOKUP function in Excel is a powerful and flexible tool designed to replace older lookup functions like VLOOKUP and HLOOKUP. Unlike these traditional functions, XLOOKUP can search both vertically and horizontally, making it ideal for retrieving specific values from any range in a table. With a
10 min read
Excel IF function With Examples
The IF function in Excel is one of the most powerful and commonly used formulas that allows you to perform logical tests and return different values based on whether the condition is true or false. If youâve ever needed to check whether a value meets certain criteria, then the IF function is the too
12 min read
Excel Date Functions with Formula Examples
There are many functions in Microsoft Excel that may be used to work with dates and timings in Excel. Each function completes a straightforward task, but by combining numerous functions into a single formula, you may handle trickier and more complicated problems. The purpose of discussing DATE funct
12 min read
Excel ROWS and COLUMNS Functions with Examples
In Microsoft Excel, where precision and efficiency reign supreme, mastering the art of maneuvering through cells and worksheets is indispensable. Two indispensable components in your Excel toolbox are the ROW and COLUMN functions, each meticulously crafted to execute discrete functions that can subs
7 min read
How to Find Duplicates in Excel: A Comprehensive Guide
Managing data effectively in Excel often requires identifying duplicate entries, which can clutter your analysis or lead to inaccuracies. Knowing how to find duplicates in Excel is essential for maintaining data integrity. From using COUNTIF to find duplicates to applying advanced filters and PivotT
9 min read
OFFSET Function in Excel With Examples
Excel contains many useful formulas and functions that make it more and more useful and at the same time user-friendly. Such a function is the OFFSET() function. In many cases, this function is also used inside another function. This function basically returns a reference of a single cell or a range
4 min read
Excel VLOOKUP Function - Excel Guide for Beginners
How to do VLOOKUP in Excel - Quick StepsPrepare Your DataEnter the VLOOKUP Formula >> Press EnterUse a Cell Reference for FlexibilityCopy the Formula for Multiple RowsAdding clickable links to your document is a simple yet powerful way to connect readers to external websites, email addresses,
15 min read
How to Use HLOOKUP in Excel (Formula & Examples)
Excel HLOOKUP Function - Quick StepsSelect the cell Enter the HLOOKUP formulaInput arguments>>Press Enter Excel is packed with features that make handling and analyzing data easier. One of these handy tools is the HLOOKUP function, which is great for finding information in tables that are orga
8 min read
How To Use MATCH Function in Excel (With Examples)
Finding the right data in large spreadsheets can often feel like searching for a needle in a haystack. This is where the MATCH function in Excel proves invaluable. The MATCH function helps you locate the position of a specific value within a row or column, making it a cornerstone of efficient data m
6 min read
7 Uses of Excel in Business with Real World Examples
Ever wondered how businesses turn raw data into actionable strategies or manage complex budgets with precision? The answer often lies in a tool you might already have: Microsoft Excel. From tracking sales trends to forecasting expenses, Excel remains a cornerstone of business Excel tools, offering u
6 min read