How to Use the XLOOKUP Function to Replace Complex INDEX/MATCH Formulas in Excel

The Evolution of Excel Lookups

For years, VLOOKUP was the undisputed king of Excel data retrieval, despite its severe limitations (most notably, its inability to search to the left). As Excel power users sought more robust solutions, the combination of INDEX and MATCH became the gold standard. However, INDEX/MATCH formulas are notoriously difficult to read, teach, and troubleshoot.

With the introduction of the XLOOKUP function, Microsoft rendered both VLOOKUP and INDEX/MATCH obsolete for modern data analysis. XLOOKUP is designed to be highly intuitive, flexible, and performant, allowing you to search in any direction, return exact matches by default, and handle missing data gracefully.

Why XLOOKUP is Superior to INDEX/MATCH

The traditional INDEX(return_array, MATCH(lookup_value, lookup_array, 0)) requires wrapping one function inside another. It forces the user to manage two separate arrays and remember to explicitly set the match type to `0` for an exact match, otherwise, the formula defaults to an approximate match—a common source of critical errors in financial models.

XLOOKUP streamlines this into a single function: =XLOOKUP(lookup_value, lookup_array, return_array).

  • Exact Match Default: XLOOKUP assumes you want an exact match unless told otherwise.
  • Left-to-Right Independence: Like INDEX/MATCH, it doesn’t care about column order. You can lookup a value in column Z and return a value from column A.
  • Built-in Error Handling: XLOOKUP includes an “if_not_found” argument, eliminating the need to wrap your formula in IFERROR().

Step-by-Step Guide: Migrating to XLOOKUP

Understanding the Syntax

The full syntax for XLOOKUP is:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

However, 90% of use cases only require the first three arguments.

Example 1: The Basic Replacement

Suppose you have Employee IDs in column A, and Employee Names in column B. You want to look up the name for Employee ID “105” (located in cell E1).

The old INDEX/MATCH way:
=INDEX(B:B, MATCH(E1, A:A, 0))

The new XLOOKUP way:
=XLOOKUP(E1, A:A, B:B)

The XLOOKUP formula is significantly shorter, reads logically from left to right (what am I looking for, where am I looking, what do I want back), and is far less prone to syntax errors.

Example 2: Handling Missing Data (Replacing IFERROR)

If the Employee ID doesn’t exist, both VLOOKUP and INDEX/MATCH will return a #N/A error. To make the spreadsheet presentable, users typically wrap the function.

The old INDEX/MATCH way:
=IFERROR(INDEX(B:B, MATCH(E1, A:A, 0)), "Not Found")

The new XLOOKUP way:
=XLOOKUP(E1, A:A, B:B, "Not Found")

By utilizing the optional fourth argument, the formula remains clean and highly readable.

Example 3: Returning Multiple Columns at Once

One of the most powerful features of XLOOKUP is its ability to return dynamic arrays. If you want to return the Employee Name (Column B), Department (Column C), and Salary (Column D) simultaneously, you no longer need to write three separate formulas or use complex COLUMN() math.

The XLOOKUP way:
=XLOOKUP(E1, A:A, B:D)

Excel will find the match in Column A and automatically “spill” the results from columns B, C, and D into adjacent cells. This dramatically reduces computation time in large workbooks.

Advanced Feature: Search Mode (Last to First)

INDEX/MATCH stops at the first match it finds searching from the top down. If you wanted to find the last occurrence of an item in a list (e.g., finding a customer’s most recent purchase date in a chronological log), you historically needed complex array formulas.

XLOOKUP solves this natively with the search_mode argument. Setting this to -1 tells Excel to search from the bottom up.

=XLOOKUP(CustomerName, LogNames, LogDates, "No Purchases", 0, -1)

Conclusion

There is virtually no scenario in modern versions of Microsoft 365 where INDEX/MATCH is preferable to XLOOKUP. By migrating your worksheets to use XLOOKUP, you will reduce formula complexity, eliminate the need for nested error handling, and leverage the power of dynamic arrays for faster, cleaner data retrieval.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.