Formula Guide

XLOOKUP: the complete guide
with 8 real examples

XLOOKUP is the formula Microsoft built to replace VLOOKUP, HLOOKUP, and INDEX MATCH. It's simpler, more powerful, and handles errors gracefully. Here's everything you need.

EP
ExcelPro · May 20, 2026 · 9 min read
In this guide
  1. What is XLOOKUP?
  2. The syntax explained
  3. 8 real examples
  4. Handling errors
  5. Tips and gotchas

What is XLOOKUP?

XLOOKUP arrived in Excel 2019 (and Microsoft 365) as the official replacement for VLOOKUP. It addresses every major complaint people had about VLOOKUP:

If you're on Excel 2019 or Microsoft 365, you should be using XLOOKUP.

The syntax explained

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
lookup_value required
What you're searching for. Can be a value, text, or cell reference.
lookup_array required
The column (or row) to search in.
return_array required
The column (or row) to return the result from.
if_not_found optional
What to show if no match is found. Default is #N/A.
match_mode optional
0 = exact match (default). -1 = exact or next smaller. 1 = exact or next larger. 2 = wildcard.
search_mode optional
1 = first to last (default). -1 = last to first. 2 = binary search ascending. -2 = binary search descending.

For most lookups, you only need the first three arguments. The rest are for advanced use cases.

8 real examples

1Basic lookup — find a price

You have a product list and want to find the price for a specific product.

=XLOOKUP("Coffee", A2:A10, B2:B10) ← looks for Coffee in column A, returns the price from column B

2Lookup from a cell (dynamic)

Reference a cell instead of typing the value — change the cell and the result updates automatically.

=XLOOKUP(D2, A2:A10, B2:B10) ← D2 contains the product name to search for

3Handle missing values gracefully

=XLOOKUP(D2, A2:A10, B2:B10, "Not found") ← shows "Not found" instead of a #N/A error

4Look LEFT (impossible with VLOOKUP)

Your ID numbers are in column C, but the names you want to return are in column A — to the left.

=XLOOKUP(F2, C2:C10, A2:A10, "Not found") ← searches column C, returns from column A (left of C)

5Return multiple columns at once

XLOOKUP can return a whole range of columns in one formula.

=XLOOKUP(D2, A2:A10, B2:C10) ← returns both column B AND column C for the matched row

6Wildcard search

Find entries that contain a word, not exact matches.

=XLOOKUP("*coffee*", A2:A10, B2:B10, "Not found", 2) ← match_mode 2 enables wildcards. * matches any characters.

7Find the last match

If a value appears multiple times, return the last occurrence.

=XLOOKUP(D2, A2:A10, B2:B10, "Not found", 0, -1) ← search_mode -1 searches from last to first

8Two-way lookup (row AND column)

Nest two XLOOKUPs to find values at the intersection of a row and column — like reading a table.

=XLOOKUP(G2, A2:A10, XLOOKUP(H2, B1:F1, B2:F10)) ← G2 = row to find, H2 = column to find

Handling errors

The built-in fourth argument is cleaner than wrapping in IFERROR — but both work:

Option 1 — built-in (cleaner) =XLOOKUP(D2, A:A, B:B, "Not found") Option 2 — IFERROR wrapper =IFERROR(XLOOKUP(D2, A:A, B:B), "Not found")

Tips and gotchas

⚠️ XLOOKUP requires Excel 2019 or Microsoft 365

If you're sharing files with people on older Excel versions, they'll see a #NAME? error. Use VLOOKUP or INDEX MATCH for maximum compatibility.

Practise XLOOKUP now

ExcelPro has XLOOKUP exercises across all 8 tracks — in real scenarios with real data. Free to start.

Try XLOOKUP exercises →
Keep reading