XLOOKUP vs VLOOKUP: Which to Use, Where the New One Breaks, and How to Migrate
VLOOKUP has been the default answer to "look this up in that table" for thirty years, and XLOOKUP was supposed to end it. In practice both are now in the same workbook, on the same team, and the choice is not religious: XLOOKUP removes four specific failure modes that cost people entire afternoons, and it also breaks your file for anyone on Excel 2019, Excel 2016, or LibreOffice. This guide shows what each function does, the exact errors XLOOKUP eliminates, how to migrate a sheet safely, and how to write a version that works for everybody.
What each function actually does
VLOOKUP takes a value, hunts for it in the leftmost column of a range, then walks right a fixed number of columns and returns what it finds. Every limitation follows from that design: the search column must be first, the column count is a hardcoded number that silently breaks when someone inserts a column, and the fourth argument is a trap.
XLOOKUP takes a lookup value, a lookup array, and a return array, in that order, with optional arguments for "not found" and match mode. Nothing needs to be adjacent, nothing needs to be counted, and left lookups work because the arrays are independent.
| Task | VLOOKUP | XLOOKUP |
|---|---|---|
| Look up a name by employee ID, ID in column A, name in column C | =VLOOKUP(A2,$A:$C,3,FALSE) | =XLOOKUP(A2,$A:$A,$C:$C) |
| Look up an ID when the ID sits to the right of the name | Impossible without rearranging or INDEX/MATCH | =XLOOKUP(A2,$C:$C,$A:$A) |
| Show a message instead of #N/A | Wrap in IFERROR, or IF(ISNA(...)) in old versions | =XLOOKUP(A2,$A:$A,$C:$C,"Not on file") |
| Return several columns at once | Copy the formula and change the column number each time | =XLOOKUP(A2,$A:$A,$C:$E) spills three columns |
| Find the closest match above or below a number | Approximate match with a sorted table, easy to get wrong | Match mode -1 or 1, explicit in the formula |
| Search from the bottom up (last entry wins) | Not possible; needs LOOKUP tricks | Search mode -1 |
The four VLOOKUP failures XLOOKUP deletes
1. The forgotten FALSE. Leave the fourth argument out of VLOOKUP and Excel assumes approximate match, which returns a confidently wrong answer instead of an error. This is the single most expensive spreadsheet bug in business: a price list lookup that returns the previous price tier and nobody notices for a quarter. XLOOKUP defaults to exact match, so the wrong answer requires deliberate effort.
2. The hardcoded column number. =VLOOKUP(A2,Data!A:F,4,FALSE) breaks the day somebody inserts a column in Data. It does not break loudly; it returns the wrong column, which is worse. XLOOKUP's return array moves with the sheet because it names the column, not a position.
3. Left lookups. VLOOKUP cannot look left. The usual workarounds are moving the key column (which breaks every other formula referencing that sheet) or switching to INDEX/MATCH. INDEX/MATCH is genuinely good and still worth knowing, but it is two functions doing one job with two ranges in the opposite order from VLOOKUP, which is why people avoid learning it. Our comparison below keeps it in the picture.
4. #N/A noise. Every VLOOKUP sheet ends up wrapped in IFERROR, which hides real errors along with missing values. XLOOKUP's fourth argument handles "not found" natively, so you can still see a #REF! or #VALUE! when something is actually wrong.
XLOOKUP vs INDEX/MATCH: the honest comparison
INDEX/MATCH is not obsolete. It is the correct answer when the file has to open on an older Excel, because it has worked since Excel 2007 and runs everywhere. It is also marginally faster on enormous ranges, though the difference only shows on hundreds of thousands of rows. XLOOKUP is shorter, reads left to right in the order you think, and handles not-found and search direction natively.
| Criterion | XLOOKUP | INDEX/MATCH | VLOOKUP |
|---|---|---|---|
| Works in Excel 365 and 2021+ | Yes | Yes | Yes |
| Works in Excel 2019, 2016, LibreOffice, Google Sheets | No (Sheets has it now, older desktop does not) | Yes | Yes |
| Left lookups | Yes | Yes | No |
| Survives inserted columns | Yes | Yes | No |
| Default match type | Exact | Exact | Approximate (dangerous) |
| Built-in not-found message | Yes | No | No |
| Length of a typical formula | Shortest | Longest | Medium |
The practical rule most finance and operations teams settle on: build new workbooks in XLOOKUP, keep shared workbooks in INDEX/MATCH, and treat VLOOKUP as something to read rather than something to write.
How to migrate a workbook without breaking it
| Step | What you do | Why it matters |
|---|---|---|
| 1. Check who opens the file | Ask, or check the file's version history for co-authors on older Excel | An XLOOKUP in a file someone opens in Excel 2019 shows #NAME? and looks like corruption to them |
| 2. Copy before you convert | Save a version with today's date in the filename | Conversion is mechanical but a spilled array can overwrite neighbouring data |
| 3. Convert one column at a time | Replace a single VLOOKUP, verify a handful of known rows, then continue | Bulk find-and-replace on formulas produces silent mismatches |
| 4. Watch for spill collisions | Returning multiple columns needs empty space to the right | XLOOKUP returning C:E writes three cells; anything already there becomes #SPILL! |
| 5. Keep a fallback column | Leave the old formula in a hidden column for one week | Comparing old and new results side by side catches every mismatch cheaply |
Step 4 is the one that surprises people. =XLOOKUP(A2,$A:$A,$C:$E) is a single formula that returns three values, and if the two cells to its right contain anything at all, the whole thing fails with #SPILL! rather than quietly overwriting. That is a feature, not a bug, but it means converting a column of single-value VLOOKUPs into multi-column XLOOKUPs needs cleared space first.
Making XLOOKUP work for everyone
If the workbook travels to older Excel, the pattern that survives is a small named helper: keep XLOOKUP in your working copy, and for the shared copy convert to INDEX/MATCH with a formula you can generate mechanically. INDEX/MATCH for the same lookup reads =INDEX($C:$C,MATCH(A2,$A:$A,0)), which is longer but portable, and the third argument of MATCH (0) is the exact-match flag that VLOOKUP hides.
For the not-found message, INDEX/MATCH needs IFERROR around it: =IFERROR(INDEX($C:$C,MATCH(A2,$A:$A,0)),"Not on file"). That nesting is the price of portability, and it is worth paying once in a template rather than retyping it in forty cells.
One more portability note: Google Sheets added XLOOKUP, so a sheet shared with Sheets users is fine. LibreOffice does not have it, which matters if your company uses LibreOffice on the desktop. Check the one person who always opens the file in something unexpected before you commit.
Five lookups worth knowing beyond both
SUMIFS instead of lookup-then-sum. If you need a total rather than a single value, SUMIFS is faster to write and does not care about sort order: =SUMIFS($D:$D,$A:$A,A2).
XMATCH for positions. XMATCH returns where a value sits rather than what sits there, with the same search-direction options, and it pairs with INDEX for cases where XLOOKUP's return array is awkward.
FILTER for many matches. When a key appears twenty times and you want all twenty, FILTER is the tool: =FILTER($C:$C,$A:$A=A2,"none"). XLOOKUP and VLOOKUP both return the first hit only.
Wildcards still work. XLOOKUP supports * and ? in the lookup value when match mode is 2, which handles "find the row whose code starts with INV-2026".
Named ranges make both readable. =XLOOKUP(A2,EmployeeID,EmployeeName) beats a wall of absolute references, and it survives row inserts on both functions.
When to spend an evening learning this properly
Lookups are the hinge between "I use Excel" and "Excel does my work for me". If your day involves matching lists, reconciling two exports, or pulling prices and names out of a master sheet, the difference between a working lookup and a broken one is the difference between finishing at five and staying until eight. A structured course is faster than assembling the knowledge from forum posts, and if you want a starting point, this Microsoft Excel course from beginner to advanced covers lookups, pivot tables and the formula debugging habits that make them reliable (affiliate link: we earn a commission if you buy through it, at no extra cost to you). Free alternatives exist and work: Microsoft's own function documentation is accurate and short, and the practice files matter more than the video.
Whichever route you take, build one real workbook with the function instead of watching three videos about it. Take a messy export you already have, add a lookup column, break it on purpose by inserting a column in the source sheet, and watch what happens. That ten minutes teaches more than any tutorial, and it is the reason the migration steps above are ordered the way they are.
Questions people ask
Is XLOOKUP always better than VLOOKUP? On a modern Excel, yes for new work. It is shorter, defaults to exact match, looks left, and handles missing values. The exception is portability: a file that must open on Excel 2019 or LibreOffice cannot contain it.
Why does my XLOOKUP show #NAME? The Excel version opening the file does not know the function. Either the file is being opened in Excel 2019 or older, or in LibreOffice. There is no add-in that fixes this; the formula has to change.
Can XLOOKUP replace SUMIFS? No. XLOOKUP returns a value from a matching row; it does not add up many matching rows. For totals, use SUMIFS, and for a list of every match, use FILTER.
Does XLOOKUP work in Google Sheets? Yes, Sheets added it, along with XMATCH. Behaviour on not-found and match modes is close enough that formulas usually transfer, but test one before assuming.
What is the fastest way to convert a whole column of VLOOKUPs? Do not convert blindly. Convert one, compare against the old result for a set of known rows, then copy down. A find-and-replace across a sheet is how silent wrong answers get in.
The short version
New workbook, modern Excel: use XLOOKUP, in the order lookup value, lookup array, return array, with a not-found message as the fourth argument. Shared workbook that travels to older Excel: use INDEX/MATCH with MATCH's exact flag set to 0 and IFERROR for the message. Never write a new VLOOKUP with a hardcoded column number, and never leave its fourth argument empty. Check who opens the file before you convert anything, and convert one column at a time with the old formula kept nearby for a week.
Related guides: Excel COUNTIF Function: Syntax, Wildcards and 8 Examples, Excel IF Function: Multiple Conditions, Nested IF and Fixes When It Fails, How to Remove Duplicates in Excel: 4 Safe Methods and Fixes When It Finds None.
Comments
Post a Comment