VLOOKUP vs XLOOKUP Formula Generator

Describe your lookup in plain English and get a working VLOOKUP or XLOOKUP formula — with an explanation of which one fits your Excel version.

Files are processed locally and never uploaded.

How to use

  1. 1

    Describe your lookup in the question box above — the example is editable, so tweak it to match your sheet.

  2. 2

    Submit and get a working formula plus a plain-English explanation of each part.

  3. 3

    Copy the formula into your spreadsheet and adjust the cell references to your data.

The 30-second version: when to use each

VLOOKUP is the lookup function everyone learned first: it searches the leftmost column of a range and returns a value from a column to its right. XLOOKUP is its modern replacement (Excel 2021 and Microsoft 365): it searches any column, returns from any column, and defaults to exact matches instead of VLOOKUP's infamous approximate-match default.

The practical rule: use XLOOKUP if everyone who will open the file has Excel 2021, Microsoft 365, or Google Sheets (which has XLOOKUP too). Use VLOOKUP if the file might be opened in Excel 2019 or older, where XLOOKUP simply doesn't exist and shows a #NAME? error. When in doubt, generate the VLOOKUP — compatibility beats elegance.

Why VLOOKUP breaks (and XLOOKUP doesn't)

VLOOKUP has three classic failure modes. First, the lookup column must be the leftmost column of your range — look up a value and return something to its left, and VLOOKUP can't do it without rearranging your data. Second, inserting a column inside the range silently shifts the column index number, so a formula that worked yesterday returns the wrong column today. Third, the default match mode is approximate, so a missing fourth argument returns the wrong row instead of an error.

XLOOKUP fixes all three by design: =XLOOKUP(lookup_value, lookup_array, return_array) takes separate ranges, so columns can sit anywhere, inserted columns can't break it, and exact match is the default. It also has a built-in "if not found" argument, replacing the IFNA(VLOOKUP(...)) wrapper people used to write.

The compatibility caveat nobody mentions

XLOOKUP's only real weakness is version support. Excel 2019 and earlier, plus some enterprise installs frozen on older builds, don't have it — and unlike a new chart type, a missing function breaks the whole cell. If you email a workbook to a client or share it with a team on mixed Excel versions, XLOOKUP formulas will show errors on their machines.

This is why the generator asks about your situation: describe who will use the file and it will recommend the safe choice. A good habit is noting the required Excel version in a comment or a README tab when you use XLOOKUP in a shared workbook.

What the generated formula includes

The tool doesn't just hand you a formula string — it explains each argument in plain language: what the lookup value is, which range it searches, which column or range it returns, and why the match mode was chosen. That explanation is the difference between a formula you can use once and one you can adapt next week.

It also handles the common variations people actually need: lookups across sheets, two-way lookups (match on row and column), returning multiple columns at once (XLOOKUP's spill behavior), and graceful "not found" handling. Describe the variation in your own words — the example in the box is just a starting point.

Beyond both: INDEX/MATCH and the lookup family

Old-school Excel experts will tell you INDEX/MATCH is the real answer — it's the combination that does everything XLOOKUP does and works in Excel 2007 onward. They're right, and the generator can produce INDEX/MATCH formulas too if you ask for maximum compatibility with leftward lookups.

The honest hierarchy: XLOOKUP for modern files, VLOOKUP for simple rightward lookups on old Excel, INDEX/MATCH for leftward lookups on old Excel. Describe your constraints (Excel version, lookup direction) and the tool picks the right member of the family instead of forcing one answer.

Frequently asked questions

Should I still learn VLOOKUP in 2026?▼

Yes — not because it's better, but because you'll inherit a decade of spreadsheets written with it. You need to read VLOOKUP fluently even if you write XLOOKUP for everything new. The generator can also explain any VLOOKUP you paste in, which is the fastest way to learn it from real examples.

Why does my XLOOKUP show #NAME?▼

Almost certainly an old Excel version: XLOOKUP needs Excel 2021, Microsoft 365, or Google Sheets. On Excel 2019 or earlier the function doesn't exist. Either upgrade, or regenerate the formula as VLOOKUP/INDEX-MATCH for compatibility.

Can XLOOKUP return values to the left of the lookup column?▼

Yes — that's one of its main advantages over VLOOKUP. Since the lookup array and return array are separate arguments, the return column can be anywhere: left, right, or on another sheet entirely.

Does Google Sheets support XLOOKUP?▼

Yes, Google Sheets added XLOOKUP support, and the generator's Google Sheets tab produces Sheets-compatible syntax. VLOOKUP works identically in both platforms, so it's the safe cross-platform choice.

Related tools