what is XLOOKUP

What is XLOOKUP and How to Use It?

April 10th, 2026
705
05:00 Minutes

Are you an Excel user working on vast datasets? Well, then you may know how complicated it is to compare two ranges from the same or different datasets. In my opinion, it is one of the most frustrating tasks without using the perfect Excel formula. This is where you should consider using the XLOOKUP formula, which is also an advanced version of the VLOOKUP formula.

It can do everything that VLOOKUP does with various advanced additional functionalities. It is designed to make lookup tasks easier, faster, and more flexible. It helps you get the answer in seconds, whether you are working on small or complicated datasets. Once you understand it properly, it becomes one of those functions you will use almost every day. In this article, I will explain everything about the XLOOKUP function. Let’s begin.

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.

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.

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
Sanjay Prajapat
About the Author

Sanjay Prajapat is a Data Engineer and technology writer with expertise in Python, SQL, data visualization, and machine learning. He simplifies complex concepts into engaging content, helping beginners and professionals learn effectively while exploring emerging fields like AI, ML, and cybersecurity in today’s evolving tech landscape.

Drop Us a Query
Fields marked * are mandatory
×

Your Shopping Cart


Your shopping cart is empty.