The migration nobody has time for

The mandate comes down from somewhere above your pay grade: modernize the reporting workbook, replace every VLOOKUP with XLOOKUP before the fiscal-year freeze. There are ninety-four of them. You know roughly what XLOOKUP does — you have read a blog post titled something like 'the lookup function you deserve' — but argument order is not knowledge that survives a weekend, and every formula you write by hand is one bracket mistake away from silently returning the wrong vendor's payment terms.

Or maybe the situation is smaller and more familiar: you need one lookup, right now, in a spreadsheet due in forty minutes, and the VLOOKUP would need a helper column because the return value sits to the left of the key. You have heard XLOOKUP handles that. You have not internalized the syntax well enough to type it under pressure, and you do not want to learn it in front of a deadline.

The builder above is the bridge. Fill in what you know — the value to find, where to look, what to bring back — and it generates the XLOOKUP with correct syntax, quoting where needed, and explains each optional argument as you toggle it. You get the formula in seconds, and the second or tenth time you use it, the syntax starts sticking, because you have been reading correct examples instead of guessing. That is the whole point of a generator: correctness first, learning as a side effect.

What an XLOOKUP formula builder is

The tool is a form that writes the formula for you. Inputs map one-to-one onto XLOOKUP's arguments: lookup value, lookup array, return array, and the three optional settings — if_not_found text, match mode, search mode. As you fill fields, the formula assembles live in a preview pane, with syntax highlighting and validation: ranges get quoted only when they need to be, text fallbacks get their quotes, and the generated formula is guaranteed syntactically valid before you copy it.

Beyond generation, the builder teaches by annotating. Hover any argument and it shows what that slot controls in plain English; pick match mode -1 and a sentence explains exactly what 'exact or next smaller' does and when you would want it. People who use the builder three times report typing XLOOKUP from memory the fourth time — which is the correct outcome for a tool whose success metric is making itself unnecessary.

And, in the tradition of every tool on this site: nothing is uploaded, nothing is saved, no account is required. Your table ranges and lookup values are your business; the builder runs as JavaScript in the tab and forgets everything when you close it.

Where XLOOKUP came from

VLOOKUP is old enough to have opinions about music. It arrived with Excel 4.0 in 1992, and its design — a table, a column index, an approximate-match default inherited from spreadsheet-era performance constraints — shaped thirty years of workbook architecture, mostly by forcing people to arrange data with keys on the left and returns on the right. The workarounds grew their own culture: INDEX/MATCH for leftward lookups, IFNA wrappers for error handling, helper columns for multi-criteria keys. Every one of them was a patch over a function that calc circa 1992 could afford.

XLOOKUP shipped to Office Insiders in August 2019 and rolled out to Microsoft 365 subscribers across 2020 — Microsoft's own announcements pitched it as the successor, and the function library has treated it that way since. Excel 2021 and later perpetual licenses include it; Excel 2016 and 2019 never will, which matters enormously for shared workbooks (an unsupported version shows #NAME? and nothing else). Google followed by adding XLOOKUP to Sheets in 2022, and LibreOffice Calc supports it too, so the function has crossed from Microsoft feature to de facto standard in three years — unusually fast for spreadsheet grammar.

The design itself reads like a list of every complaint filed against VLOOKUP since 1992. Separate lookup and return arrays instead of a monolithic table. Exact match as the default instead of approximate. A built-in not-found handler. Search in either direction. Wildcards opt-in rather than lurking. The result is a function that is simultaneously more powerful and harder to get wrong — a rare combination in any era of software.

The six arguments, one by one

XLOOKUP takes three required arguments and three optional ones. The full signature: XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]). Here is every slot, what it controls, and its default when omitted.

ArgumentRequiredControlsDefault if omitted
lookup_valueYesThe value you are searching for—
lookup_arrayYesThe single row or column to search—
return_arrayYesThe row, column, or 2D range to return from—
if_not_foundNoResult when no match exists#N/A
match_modeNo0 exact; -1 exact or next smaller; 1 exact or next larger; 2 wildcard0 — exact match
search_modeNo1 first-to-last; -1 last-to-first; 2 binary ascending; -2 binary descending1 — first-to-last

Two design choices in that table deserve emphasis because they reverse VLOOKUP's defaults. Exact match as the default means the silent-wrong-answer failure mode — approximate match quietly returning the nearest smaller value when the key is missing — becomes an explicit #N/A you can handle on purpose. And return_array being independent of lookup_array is what makes leftward lookups ordinary: the lookup column can be D while the return column is A, no INDEX/MATCH required, no helper column, no rearranging the sheet to satisfy a function's ego.

How to use the XLOOKUP formula builder

Six fields, one preview, one copy button. The walkthrough below is the whole manual.

  1. Enter the lookup value

    Type a literal like E-1004 or, far more commonly, a cell reference like A2 so the formula fills down. The builder accepts both and quotes only what needs quoting.

  2. Point at the lookup array

    The single column or row that contains the keys — E2:E200, for instance. Paste straight from your sheet; the preview highlights it as a range token so typos in syntax are impossible.

  3. Point at the return array

    What you want brought back: a matching column (F2:F200) or a multi-column record (B:F). Multi-column returns spill, and the builder notes that when you select one.

  4. Set the not-found fallback

    Optional. Text like "not found" or 0 for numeric columns. Leave it empty and Excel shows #N/A when a key is missing — sometimes that is exactly what you want to surface.

  5. Choose match mode if needed

    Leave at exact for keys. Switch to -1 for banded data like tax brackets, 1 for the next-larger threshold, 2 only if you are doing wildcard patterns with * and ?.

  6. Choose search mode if needed

    Default finds the first match. Set -1 to find the last occurrence — latest transaction, most recent status. Binary modes need sorted data and trade flexibility for speed on huge ranges.

  7. Copy and paste into Excel

    The generated formula lands in your clipboard formatted for comma locales; a semicolon toggle re-renders it for European Excel before you copy.

Worked examples with real data

The examples below use one small payroll table so every result is checkable by eye: employee IDs in A2:A9 run E-1001 through E-1008, names in B, departments in C, salaries in D. E-1004 is Dana Whitfield, Finance, 74,500. Watch how the same builder settings produce each formula.

The basic exact-match lookup

Input

Find the salary for the ID in cell G1

Output

=XLOOKUP(G1,A2:A9,D2:D9) → 74,500 for E-1004. Exact match by default, no column counting, and it works even though salary sits three columns right of the ID — or three columns left, if you reversed them.
With a not-found fallback

Input

Same lookup, but unknown IDs should read 'not found'

Output

=XLOOKUP(G1,A2:A9,D2:D9,"not found") → an ID of E-9999 displays 'not found' instead of #N/A. One argument replaces the old IFNA wrapper entirely.
The tax-bracket lookup (match mode -1)

Input

Bracket floors in H2:H5: 0, 10276, 41776, 89076; rates in I2:I5: 10%, 12%, 22%, 24%. Income of 65,000 in J2

Output

=XLOOKUP(J2,H2:H5,I2:I5,,-1) → matches 41,776, the largest floor below 65,000, and returns 22%. This is how banded lookups should always have worked — no approximate-VLOOKUP folklore, no sorted-table warnings ignored.
The last-occurrence lookup (search mode -1)

Input

Transaction log with customer IDs repeated in M2:M500, amounts in N2:N500. Find the most recent charge for the ID in G2

Output

=XLOOKUP(G2,M2:M500,N2:N500,,0,-1) → returns the amount from the final row where that ID appears, because the scan runs last-to-first. VLOOKUP cannot express this at any price.
The full-record spill

Input

Return name, department, and salary for the ID in G1

Output

=XLOOKUP(G1,A2:A9,B2:D9) → spills three cells: Dana Whitfield, Finance, 74,500. One formula retrieves the whole record; add columns to the return range and the spill grows.

Note the double comma in the bracket and last-occurrence examples — it skips the if_not_found slot to reach the mode arguments, standard Excel syntax for 'leave the optional argument at its default.' The builder handles this for you, inserting the empty slots in the right positions, which is precisely the fiddly detail people get wrong typing from memory.

Converting VLOOKUPs: the translation table

For the migration project, here is every VLOOKUP pattern you inherited and its XLOOKUP equivalent. Print this next to the coffee machine; the whole team will need it by Thursday.

Legacy patternXLOOKUP replacementWhat you gain
=VLOOKUP(A2,D:F,3,FALSE)=XLOOKUP(A2,D:D,F:F)No column counting; inserting a column can't break it
=IFNA(VLOOKUP(A2,D:F,3,FALSE),"none")=XLOOKUP(A2,D:D,F:F,"none")Fallback is a native argument, not a wrapper
=INDEX(B:B,MATCH(A2,D:D,0))=XLOOKUP(A2,D:D,B:B)Leftward lookup without the two-function incantation
=VLOOKUP(A2,D:F,3) approximate=XLOOKUP(A2,D:D,F:F,,-1)Banded lookups with an explicit, documented mode
=VLOOKUP(A2&"|",key-col,3,FALSE) helper-key=XLOOKUP(1,(D:D=A2)*(E:E="TX"),F:F)Multi-criteria without concatenation columns
=INDEX(F:F,MATCH(9.99E+307,D:D)) last numeric=XLOOKUP(9.99E+307,D:D,F:F,,-1)Last-occurrence logic as a real search mode

The multi-criteria row deserves its warning: =XLOOKUP(1,(D:D=A2)*(E:E="TX"),F:F) multiplies two Boolean arrays so that rows matching both criteria equal 1, then looks up that 1. It is powerful, it is standard, and whole-column references in array context can be slow on giant sheets — bound your ranges (D2:D5000) rather than D:D when the workbook is big. The builder generates bounded versions by default for exactly this reason.

Edge cases and honest limits

The version wall is the big one: XLOOKUP does not exist in Excel 2016 or Excel 2019, and a workbook opened there shows #NAME? in every converted cell. Before migrating a shared file, check who opens it and with what — File → Account in their Excel, or a quick =ISFORMULA audit of their complaints. Excel for the web includes XLOOKUP with a Microsoft account, which covers most holdout cases.

The binary search modes (2 and -2) demand sorted lookup arrays and return garbage silently when given unsorted data — faster on millions of rows, treacherous otherwise, and reasonable people just avoid them outside enormous datasets. Wildcard match mode 2 reverses the usual default too: XLOOKUP does not treat * and ? as wildcards unless you opt in, so a lookup value containing an asterisk finds the literal string, not a pattern. That protects more formulas than it surprises, but the reversal from older habits catches people who memorized SEARCH's behavior.

Spilled returns are the modern trap. A multi-column XLOOKUP occupies the cells to its right; if something blocks them you get #SPILL!, and if the blocker is another formula's spill you get a chain of them. The discipline: leave the row clear for the width of your return range. Also remember that two-way lookups nest cleanly — =XLOOKUP(G1,A2:A9,XLOOKUP(G2,B1:D1,B2:D9)) — the inner function slices the column, the outer finds the row, and the whole thing reads more naturally than INDEX/MATCH/MATCH ever did.

Who uses a formula generator

The obvious audience is anyone mid-migration: analysts converting legacy workbooks one tab at a time, template authors rewriting the lookup layer once and correctly, and consultants delivering modernized files to clients on current Excel. The generator keeps ninety-four conversions consistent — same quoting style, same fallback convention, same bounded ranges — which hand-typing never manages.

The quieter audience is learners and occasional users: students meeting XLOOKUP for the first time in a course, small-business owners building their own trackers one formula a month, and spreadsheet-sharers who need today's lookup to work today. For them the builder is training wheels that also save the deliverable — every generated formula is a correct worked example, and reading correct examples is how syntax becomes memory. The power users arrive eventually; the tool meets everyone else where they are.

Why exact-by-default matters: the silent-wrong-answer problem

VLOOKUP's most dangerous property was never its clumsiness — it was the default. Omit the fourth argument and VLOOKUP switches to approximate match, returning the nearest smaller value for any key it cannot find. Not an error. A plausible, confidently wrong answer sitting in a cell where a number belongs. Entire procurement analyses have run on this behavior for months before anyone noticed, because the failure mode produces numbers that look exactly like success.

XLOOKUP's default reverses it: no match produces #N/A, loud and immediate, and the builder's fallback field turns that loudness into a designed outcome — 'not found', 0, a blank, whatever your report actually needs. This is the deeper reason the migration is worth the effort beyond tidiness. You are not just modernizing syntax; you are converting a workbook's default failure mode from silent-wrong to visible-and-handled. Auditors have a phrase for systems designed that way, and it is flattering.

The banded use case keeps approximate behavior where it belongs — as an explicit, opt-in match mode with a documented meaning. The bracket lookup example earlier in this page is the pattern: bracket floors in one column, rates in the next, match mode -1, and the formula returns the correct tier for any income. Compare that to the legacy approach, where the same result required a sorted table, a TRUE flag, and tribal knowledge that the table had to stay sorted forever. Explicit beats remembered.

Performance notes for big workbooks

For normal workbooks — thousands of rows, dozens of lookups — XLOOKUP performance is a non-issue and you can stop reading. The notes below matter only at scale: hundreds of thousands of rows, lookups inside tables that recalculate on every keystroke, workbooks that already lag.

  • Bound your ranges. XLOOKUP(B2,D2:D50000,F2:F50000) beats XLOOKUP(B2,D:D,F:F) because whole-column references force Excel to reason about a million rows per lookup, every recalculation.
  • Binary search modes (2 and -2) are dramatically faster on sorted ranges at extreme scale — hundreds of thousands of rows — and garbage on unsorted data. Sort first, or stay linear.
  • One spilled multi-column XLOOKUP beats five single-column ones over the same data: one scan instead of five, and the spill updates as one unit.
  • Multi-criteria array lookups multiply cost by the number of conditions; on big logs, two helper columns with a concatenated key can genuinely outperform the elegant one-liner. Elegant and fast are not always the same spreadsheet.
  • Volatile neighbors matter more than the lookup itself: if a NOW() or INDIRECT() lives anywhere in the dependency chain, everything recalculates on every edit, and your XLOOKUPs take the blame.

The rule of thumb that survives every benchmark: make the lookup findable and the range bounded, and performance takes care of itself. When a workbook is genuinely slow, the culprit is usually a volatile function or a whole-column reference multiplied across a thousand formulas — both of which the builder's defaults avoid by generating bounded ranges from the start.

From generated to verified: the confidence loop

A generated formula is only as good as your confidence in it, so build verification into the same minute you build the formula. The cheap method: make your first lookup a key you already know the answer for. If E-1004 is Dana Whitfield at 74,500, generate the formula pointed at E-1004 and confirm it returns exactly that. One known-answer test catches reversed arrays, wrong-sheet references, and the classic swapped lookup/return mistake — which produces plausible garbage instead of an error and is therefore the most dangerous typo in the family.

The second test is a deliberate miss. Point the formula at a key that cannot exist — E-9999 in the payroll table — and watch the fallback fire. If you set 'not found' and you see 'not found', the not-found path works; if you see #N/A anyway, the argument landed in the wrong slot and the formula needs a second look. Testing the failure path of anything is the habit that separates spreadsheet work from spreadsheet hope, and it costs five seconds here.

The third test is boundary, for banded lookups only: feed the bracket formula a value exactly on a floor — 41,776 in the tax example — and confirm it returns that bracket, not the one below. Off-by-one at boundaries is where banded logic breaks, and a single boundary check exposes it before the report ships. Three tests, under a minute total, and the formula you paste into the workbook arrives pre-verified. The builder writes it; you prove it; nobody relives the procurement analysis of 2019.

Questions people actually ask

Is XLOOKUP available in Excel 2016 or Excel 2019?

No. XLOOKUP shipped to Office Insiders in August 2019 and rolled out to Microsoft 365 through 2020, then to Excel 2021 perpetual licenses. Excel 2016 and 2019 return #NAME? — their function library predates it. Check File → Account for your version before converting a workbook.

What's the main difference between VLOOKUP and XLOOKUP?

Three big ones: XLOOKUP defaults to exact match instead of approximate; it takes separate lookup and return arrays, so it works in any direction including right-to-left; and it has a built-in if_not_found argument that replaces IFNA wrapping. It also cannot break when someone inserts a column, because there is no column index to count.

How do I make XLOOKUP return something instead of #N/A?

Use the fourth argument: =XLOOKUP(A2,D:D,E:E,"not found") displays the fallback text instead of the error. That single argument replaces the old IFNA(VLOOKUP(...),"not found") pattern entirely.

Can XLOOKUP return multiple columns?

Yes — point return_array at more than one column, like B:E, and the formula spills adjacent results across your row. One XLOOKUP can retrieve a whole record: name, department, and salary from one formula, no copy-across-with-offset hacks.

What does match mode -1 mean?

Exact match or the next smaller value. It is the banded-lookup mode: with a table of bracket floors (0, 10276, 41776...), a lookup of 65,000 finds 41,776 — the largest floor below it — and returns that row. This is how tax brackets, commission tiers, and shipping zones should be built.

How do I find the last matching value instead of the first?

Set search_mode to -1, last-to-first. XLOOKUP scans from the end and returns the final occurrence — the latest transaction for a customer, the most recent status for a ticket — something VLOOKUP could never do without sorting or array gymnastics.

Does XLOOKUP work in Google Sheets?

Yes, Google added XLOOKUP to Sheets in 2022 with the same argument order and match modes. Formulas built here paste directly into Sheets. LibreOffice Calc also supports it in current versions.

Can XLOOKUP do a two-way lookup?

Nest two of them: =XLOOKUP(row_value, row_headers, XLOOKUP(col_value, col_headers, data_range)) — the inner XLOOKUP slices out the matching column, the outer one finds the row. It replaces the INDEX/MATCH/MATCH triple and is genuinely easier to read.

Sources

Sources and further reading

  • Microsoft Support, XLOOKUP function — https://support.microsoft.com/en-us/office/xlookup-function-b7fd680e-6d10-43e6-84f9-88eae8bf5929 (official argument reference, match modes, search modes)
  • Wikipedia, XLOOKUP — https://en.wikipedia.org/wiki/XLOOKUP (release timeline: Office Insiders August 2019, Microsoft 365 rollout 2020)
  • Microsoft Support, Excel help and learning — https://support.microsoft.com/en-us/excel (function availability by version and error behavior)
  • Exceljet, XLOOKUP function — https://exceljet.net/functions/xlookup-function (worked examples and the VLOOKUP-comparison patterns)

We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.