Mastering Excel Lookup & Reference Functions: XLOOKUP and XMATCH Explained

If you've ever struggled with finding data in Excel, you’re not alone! While classic lookup functions like VLOOKUP and HLOOKUP have been around for ages, they come with frustrating limitations. Luckily, Microsoft introduced two powerful alternatives—XLOOKUP and XMATCH—which make searching for data easier and more flexible.

In this post, I'll walk you through how these functions work, their advantages, and how you can use them to simplify your workflow.


Why Use XLOOKUP Instead of VLOOKUP or HLOOKUP?

XLOOKUP is the modern replacement for VLOOKUP, HLOOKUP, and even INDEX-MATCH. It fixes many of the problems that made those functions tricky to use. Here’s why you should consider using XLOOKUP:

No More Column Index Numbers – Unlike VLOOKUP, you don’t have to count column numbers. 

Works with Vertical and Horizontal Data – No need to choose between VLOOKUP (vertical) and HLOOKUP (horizontal). 

No Need for Sorted Data – XLOOKUP can find exact matches without requiring data to be sorted. 

Performs Leftward Lookups – VLOOKUP can only search rightward, but XLOOKUP can look in any direction.

How to Use XLOOKUP

The XLOOKUP function follows this structure:

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

Let’s break it down with an example.

Imagine you have a list of employees and their salaries, and you want to find the salary of a specific employee.

Employee Salary
Alice $50,000
Bob $60,000
Charlie $55,000

To find Bob’s salary, you’d use:

=XLOOKUP("Bob", A2:A4, B2:B4, "Not Found")

This will return $60,000. If “Bob” isn’t in the list, it will return “Not Found.”


XMATCH: A Smarter MATCH Function

XMATCH is like an upgraded version of the MATCH function. Instead of returning a value, it returns the relative position of an item in a range.

Why is XMATCH better than MATCH?

Supports Exact and Approximate Matches – You can specify whether you want an exact match, the next largest, or the next smallest value. 

Can Search in Reverse Order – Unlike MATCH, XMATCH can search from bottom to top. 

Works with Arrays – Making it more dynamic when combined with other functions.

How to Use XMATCH

The syntax is:

=XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])

Example:

Let’s say we want to find the position of "Charlie" in our employee list:

=XMATCH("Charlie", A2:A4)

This will return 3, since Charlie is the third name in the list.


When to Use XLOOKUP vs. XMATCH?

  • Use XLOOKUP when you need to return a specific value from a table.
  • Use XMATCH when you just need the position of an item, not its value.

For example, if you’re working with dynamic formulas that require a row or column index, XMATCH can be useful inside an INDEX function.


Final Thoughts

If you're still using VLOOKUP or MATCH, it's time to upgrade! XLOOKUP and XMATCH make data retrieval faster, easier, and more flexible. Whether you're working with financial reports, inventory lists, or employee databases, these functions will save you time and effort.

Try them out in your next Excel project and let me know how they work for you!

Comments