what is XLOOKUP

What is XLOOKUP and How to Use It?

August 14th, 2026
1193
05:00 Minutes

Working with large datasets in Microsoft Excel often requires you to find a specific value and return the related information from another range. This is where the XLOOKUP function becomes useful.

It provides a flexible way to search for data and return the matching result without many of the limitations associated with older lookup functions such as VLOOKUP and HLOOKUP. XLOOKUP can search in different directions, return values from another range, handle missing results with a custom message, and search from the beginning or end of a range.

In this guide, you will learn what XLOOKUP is, understand its syntax, use it with practical examples, compare it with VLOOKUP, troubleshoot common errors, and learn when XLOOKUP is the better choice for your Excel tasks.

Learn how to use XLOOKUP function in Excel and Google Sheets to find a specific value by just selecting what to look for, where to look, and what to return.

What is XLOOKUP in Excel?

XLOOKUP is a modern Excel function that allows you to search for a value in a range and return a corresponding value from another range. The biggest advantage of XLOOKUP is that it is not restricted like older functions. It works in any direction. You can look left, right, up, or down.

You also do not need to count columns, which removes one of the most common errors people make with VLOOKUP. It also allows you to handle errors easily and even search from the bottom to get the latest value. XLOOKUP is considered a more powerful and user-friendly replacement, or I can say a superior successor to VLOOKUP and HLOOKUP. It does not require sorted data, allows looking to the left, and defaults to an exact match.

It works like this: you search for something, then Excel finds it and returns what you need. For instance, suppose you have a list of employees with their IDs and salaries. If you know the employee ID and want to find the salary, XLOOKUP will do that instantly.

Syntax of XLOOKUP

To use XLOOKUP correctly, you need to understand its structure. This is the syntax of XLOOKUP:

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

Let’s break down the syntax of XLOOKUP into simple parts:

  • Lookup_value: LOOKUP_VALUE is the value that you are searching for. It can be a number, text or a cell reference.
  • Lookup_array: This is the range where Excel will search for the lookup value.
  • Return_array: RETURN_ARRAY is the range from which Excel will return the result.
  • if_not_found (optional): This allows you to show a custom message instead of an error if the value is not found.
  • match_mode (optional): This defines how Excel should match the value. 0 means exact match (default) and -1 or 1 is used for approximate matches.
  • search_mode (optional): This decides the direction of the search. 1 means search from top to bottom and -1 means search from bottom to top.

XLOOKUP Availability

XLOOKUP is available in modern versions of Microsoft Excel, including Microsoft 365, Excel 2024, and Excel 2021. It is also available in Excel for Mac and other supported Excel platforms.

However, it is not available as a native function in Excel 2016 and Excel 2019. Therefore, you should check your Excel version before using this formula in a workbook that needs to work on older systems. If you are using an older version such as Excel 2016 or Excel 2019, you may need to use VLOOKUP, HLOOKUP, or the INDEX and MATCH combination instead.

Note: Before sharing a workbook with other users, it is important to consider Excel version compatibility. A formula containing XLOOKUP may not work correctly when opened in an older version that does not support the function.

How to Use XLOOKUP Step-by-Step?

Let’s make this very practical so you can apply it directly.

1. Identify what you want to search: This is your lookup value. It can be an ID, name or product.

2. Select the lookup range: This is where Excel will search for the value that you put under the lookup value.

3. Select the return range: This is the column from which you want the result.

4. Write the formula: Type the XLOOKUP formula using the correct ranges.

5. Press Enter: Excel will instantly return the result.

Also Read: Excel Cheat Sheet

Basic Example of Using XLOOKUP

Let’s look at some real examples that you can try by yourself in Excel.

Example 1: Find Employee Salary

If you want to find the salary of employee ID 101, you need to use:

=XLOOKUP(A2, A2:A9, B2:C9)

Excel will search for A2 in column A and return the corresponding salary from column C with their name from column B.

xlookup-example

Example 2: Find Product Price

If you want to find the price of B6, use:

=XLOOKUP(B6,B2:B6,B2:C6)

xlookup-example

Example 3: Find Last Match (Latest Entry)

If you want the latest sales value of “Laptop(as in B2 is laptop)”, use:

=XLOOKUP(B2,B2:B6,B2:C6, , , -1)

xlookup-example

Common Errors in XLOOKUP and How to Fix Them

Even though XLOOKUP is simple, you may still face a few common issues.

1. #N/A Error

This happens when the value is not found in the lookup range. You can fix it by adding a custom message:

=XLOOKUP(A2, B2:B10, C2:C10, "Not Found")

2. Incorrect Results

Sometimes the formula runs, but the result is wrong. This usually happens because of extra spaces or mismatched data. You can fix this by cleaning your data or using TRIM.

3. Data Type Issues

If numbers are stored as text, XLOOKUP may not match them correctly. Make sure your data types are consistent.

4. Wrong Range Selection

If your lookup array and return array are not aligned properly, the result will be incorrect. Always ensure both ranges have the same size.

XLOOKUP vs VLOOKUP: Key Differences

Both XLOOKUP and VLOOKUP are used to find and return data in Excel, but XLOOKUP is more flexible and easier to use. Here’s a quick comparison for you to understand the key differences:

Feature XLOOKUP VLOOKUP
Direction It can work in any direction (left, right, up, down) It only works left to right
Column Reference No need to count columns It requires a column index number
Error Handling Built-in (if_not_found) Needs IFERROR separately
Default Match It is an exact match by default It is an approximate match by default (can cause errors)
Search Mode It can search from the top or the bottom It only searches from the top
Handling Missing Values It can return a custom message It shows #N/A error
Flexibility It is very flexible It has limited flexibility
Ease of Use It is simple and readable It is slightly confusing for beginners
Performance It is better for large datasets It is slower with large data
Availability Excel 365, Excel 2021 It is available in older versions of Excel.

XLOOKUP vs INDEX MATCH

XLOOKUP and INDEX MATCH can both be used to search for a value and return a related result. INDEX MATCH has been a popular alternative to VLOOKUP because it allows more flexible lookups, while XLOOKUP provides similar flexibility with a simpler formula. Microsoft also recommends INDEX and MATCH as a lookup combination when working with scenarios where VLOOKUP is not suitable.

For example, suppose employee IDs are in column A and salaries are in column C. With XLOOKUP, you can write:

=XLOOKUP(E2,A2:A10,C2:C10)

The same lookup using INDEX MATCH would be:

=INDEX(C2:C10,MATCH(E2,A2:A10,0))

Both formulas can return the same result, but XLOOKUP is generally easier to read because the lookup and return ranges are specified directly. INDEX MATCH separates the lookup position from the returned value, which makes the formula slightly more complex for beginners.

Feature XLOOKUP INDEX MATCH
Formula Structure It uses a single function with lookup and return ranges. It combines INDEX and MATCH functions.
Ease of Use It is simpler and easier to understand. It requires understanding two functions.
Lookup Direction It can look left, right, up, or down. It can also perform flexible lookups.
Exact Match Exact match is the default. You normally specify 0 in MATCH for an exact match.
Error Handling It has a built-in if_not_found argument. You generally need IFERROR or another error-handling method.
Last Match It can search from the bottom using search_mode. It usually requires a more complex formula for similar requirements.
Compatibility Requires a modern Excel version that supports XLOOKUP. Works with much older Excel versions.
Best For Modern Excel workbooks and simple, flexible lookups. Legacy workbooks and users who need broader backward compatibility.

When Should You Use XLOOKUP?

You should use XLOOKUP in almost all modern Excel tasks. It is especially useful when:

  • When you are working with large datasets.
  • When you need quick and accurate lookups.
  • When your data is not arranged in a fixed format.
  • When you want to reduce errors and improve efficiency.

Wrap-Up

XLOOKUP is one of the most powerful and practical functions in Excel. It simplifies the process of finding and retrieving data. This makes your work faster and cleaner. If you take a little time to practice it, then you will notice a big difference in how you work with Excel.

Tasks that used to feel confusing will start feeling simple. Once you get comfortable with XLOOKUP, you will naturally prefer it over older functions because of its flexibility and ease of use.

FAQs

1. Is XLOOKUP better than VLOOKUP?

Yes, XLOOKUP is more flexible, easier to use, and removes many limitations of VLOOKUP.

2. Does XLOOKUP work in all Excel versions?

No, it is available in Excel 365 and Excel 2021.

3. Can XLOOKUP handle text and numbers?

Yes, XLOOKUP can work with both text and numbers.

4. What happens if the value is not found?

If the values are not found, then it shows #N/A. Yet, you can always replace it with a custom message.

5. Is XLOOKUP difficult to learn?

No, it is simple to learn XLOOKUP. Once you understand the basics, you can use it easily in real work.

About the Author
Vinay Agarwal | igmGuru
About the Author

Vinay Agarwal has worked extensively with Microsoft technologies, from Azure infrastructure to productivity tools, helping IT professionals prepare for certification exams. Having sat the exams himself, he knows the gap between exam content and real-world application. He tracks Microsoft's product and certification updates, keeping his guidance current and genuinely useful.

Drop Us a Query
Fields marked * are mandatory
×

Your Shopping Cart


Your shopping cart is empty.