Formula Guide

The Excel XLOOKUP Function
explained simply

XLOOKUP is the modern replacement for VLOOKUP. Cleaner, more powerful, and easier to write. Here is everything you need.

ExcelPro · 6 min read · Updated June 2026
Contents
  1. What does XLOOKUP do?
  2. Syntax
  3. 6 real examples
  4. XLOOKUP vs VLOOKUP
  5. Common mistakes
  6. FAQ

What does XLOOKUP do?

XLOOKUP searches a column (or row) for a value and returns the corresponding result from another column (or row). It was introduced in Excel 2019 as the official replacement for VLOOKUP, HLOOKUP, and INDEX MATCH — doing everything they do, with a cleaner syntax and fewer limitations.

If you are learning Excel in 2026, start with XLOOKUP. Only learn VLOOKUP so you can understand spreadsheets built by others.

Syntax

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
ArgumentDescription
lookup_value requiredWhat to search for — a value, text, or cell reference.
lookup_array requiredThe column to search in.
return_array requiredThe column to return the result from. Unlike VLOOKUP, this is a range — not a number.
if_not_found optionalWhat to show when nothing is found. Defaults to #N/A if omitted.
match_mode optional0 = exact (default), -1 = exact or next smaller, 1 = exact or next larger, 2 = wildcard.
search_mode optional1 = first to last (default), -1 = last to first, 2/−2 = binary search.
💡 For most lookups

You only need the first three arguments. XLOOKUP defaults to exact match — no need to add a 0 at the end like VLOOKUP.

6 real examples

Example 1
Basic lookup — find a price
=XLOOKUP("Coffee", A2:A100, B2:B100)

Search column A for "Coffee" and return the corresponding value from column B.

Example 2
Handle missing values cleanly
=XLOOKUP(D2, A2:A100, B2:B100, "Not found")

The fourth argument shows a friendly message instead of an ugly #N/A error.

Example 3
Look LEFT (impossible with VLOOKUP)

Product codes in column C, names in column A. XLOOKUP can return values to the left.

=XLOOKUP(F2, C2:C100, A2:A100, "Not found")
Example 4
Return multiple columns at once
=XLOOKUP(D2, A2:A100, B2:C100)

Specify a multi-column return array and XLOOKUP returns all columns for the matched row simultaneously.

Example 5
Find the last occurrence
=XLOOKUP(D2, A2:A100, B2:B100, "Not found", 0, -1)

Search mode -1 searches from last to first — useful when a value appears multiple times and you want the most recent.

Example 6
Wildcard search
=XLOOKUP("*coffee*", A2:A100, B2:B100, "Not found", 2)

Match mode 2 enables wildcards. * matches any characters, so "Iced Coffee" and "Coffee Latte" both match.

XLOOKUP vs VLOOKUP

FeatureVLOOKUPXLOOKUP
Look left❌ No✅ Yes
Survives column insertion❌ No✅ Yes
Built-in error handling❌ No✅ Yes
Returns multiple columns❌ No✅ Yes
Works in older Excel✅ Yes❌ 2019+ only
Easier syntax❌ Harder✅ Easier

Common mistakes

⚠️ Only available in Excel 2019+

XLOOKUP doesn't exist in Excel 2016 or earlier. If you share files with users on older versions, use VLOOKUP or INDEX MATCH for compatibility.

⚠️ Lookup and return arrays must be the same length

If lookup_array has 100 rows, return_array must also have 100 rows. Mismatched sizes return a #VALUE! error.

⚠️ Case insensitive by default

XLOOKUP doesn't distinguish between "coffee", "Coffee" and "COFFEE". For case-sensitive lookup, combine with EXACT in a more complex array formula.

FAQ

Does XLOOKUP work in Google Sheets?
Yes, Google Sheets added XLOOKUP support. However, some advanced arguments may behave slightly differently — test carefully if cross-platform compatibility matters.
Can XLOOKUP look up two values at once (two-way lookup)?
Yes — nest two XLOOKUPs: =XLOOKUP(row_value, A2:A10, XLOOKUP(col_value, B1:F1, B2:F10)). The inner XLOOKUP finds the right column, the outer finds the right row.
What replaces HLOOKUP?
XLOOKUP replaces HLOOKUP too. Instead of searching down a column, set lookup_array and return_array to rows and XLOOKUP searches horizontally.

Practise XLOOKUP live

ExcelPro has XLOOKUP exercises across all tracks — real data, instant feedback, free to start.

Try XLOOKUP exercises →

Related formulas

VLOOKUP INDEX MATCH MATCH IFERROR SUMIF IF