ExcelCleansing
← All tools

XLOOKUP Generator

Build any XLOOKUP formula visually. Fill in the fields below — text vs. cell references are quoted automatically. Copy the result and paste straight into Excel.

No data leaves your browser

What you're searching for. Type text (Apple) or a cell ref (A2).

The column to search in.

The column whose value you want returned.

Shown when no match exists. Defaults to #N/A if left blank.

How Excel decides what counts as a “match”.

Your formula

=XLOOKUP(lookup_value, lookup_array, return_array)

Fill in Lookup Value, Lookup Array, and Return Array to enable copy.

XLOOKUP vs VLOOKUP: Why You Should Switch

XLOOKUP is the modern replacement for VLOOKUP and the older INDEX/MATCH pattern. If you've been writing Excel formulas for years, the switch is worth making — XLOOKUP fixes every annoying quirk that made VLOOKUP fragile.

1. VLOOKUP breaks when you insert a column. XLOOKUP doesn't.

VLOOKUP uses a column index number — for example, VLOOKUP(A2, Data!A:D, 3, FALSE) asks for the 3rd column of the range. The moment a teammate inserts a new column between A and D, your formula silently starts returning the wrong values.

XLOOKUP takes two ranges directly — the lookup array and the return array — so inserting columns can't break the link. The formula keeps working until you delete one of those columns outright.

2. XLOOKUP can look to the left.

VLOOKUP can only return values from columns to the right of the lookup column. Need to look up a product code (column C) and return the SKU prefix from column A? VLOOKUP can't do it — you have to rearrange your data or fall back to INDEX/MATCH.

XLOOKUP has no such restriction. The lookup array and return array can be anywhere in the workbook, in any order.

3. Exact match is the default.

VLOOKUP's 4th argument defaults to TRUE (approximate match), which is almost never what you actually want and silently returns the wrong row on unsorted data. Forgetting the explicit FALSE has caused more reporting bugs than just about any other Excel quirk.

XLOOKUP defaults to exact match. You explicitly opt-in to approximate matching via the Match Mode argument when you actually want it (e.g., for tax-bracket lookups).

4. Built-in “If Not Found” — no more IFERROR wrapping.

With VLOOKUP, handling missing values means wrapping the whole formula in IFERROR(VLOOKUP(…), “Not Found”). XLOOKUP takes that string as its 4th argument directly, keeping the formula readable.

XLOOKUP returning #N/A even though the value is right there?

Nine times out of ten the data has hidden whitespace — non-breaking spaces (U+00A0), zero-width characters, or trailing tabs — that make two visually-identical cells unequal to Excel. Run your source through our Spreadsheet Cleaner first — it strips every invisible character in one click and your XLOOKUP will start matching again.

When can't I use XLOOKUP?

XLOOKUP is only available in Excel 2021, Microsoft 365, and Excel for the web. If you're on Excel 2019 or earlier, you'll need to fall back to INDEX/MATCH (which is more robust than VLOOKUP for the same reasons XLOOKUP is). For Google Sheets, use XLOOKUP — it's supported there too.

Source data messy? Clean it first.

Hidden spaces, merged cells, ghost characters — any of these will make XLOOKUP miss matches it should have found. The Spreadsheet Cleaner handles them in one click.

Open Spreadsheet Cleaner →

You might also need…

Other tools in the ExcelCleansing suite that pair well with this one.