If you are deciding between XLOOKUP vs VLOOKUP, the short answer is that XLOOKUP is easier to write and harder to break, while VLOOKUP still works everywhere. This guide compares both in Excel and Google Sheets, shows a worked example, and explains when INDEX and MATCH or even HLOOKUP is the better pick.
XLOOKUP vs VLOOKUP in Excel: what each one does
Both formulas find a value in one column and return a related value from another. A typical use is looking up a product code and returning its price.
VLOOKUP
VLOOKUP takes four arguments: the value to find, the table to search, the column number to return, and whether you want an exact match. The search value must sit in the first column of the table, and the result must be to its right.
=VLOOKUP(A2, Products!A:C, 3, FALSE)
XLOOKUP
XLOOKUP takes the value to find, the column to search, and the column to return. Optional arguments cover what to show when nothing is found and how to match.
=XLOOKUP(A2, Products!A:A, Products!C:C, "Not found")

XLOOKUP vs VLOOKUP difference: the main points
- No column numbers. If someone inserts a column inside a VLOOKUP table, the "3" now points at the wrong data. XLOOKUP points at the return column itself, so inserting a column does not break it.
- It can look left. The return column can be anywhere. VLOOKUP cannot return a column to the left of the search column.
- Exact match is the default. Forgetting the final FALSE in VLOOKUP gives an approximate match, which can return a wrong row without any error.
- Built-in "not found" text. The fourth argument replaces #N/A with your own message, so you do not need IFERROR.
- Search from the bottom. A search mode option finds the last match instead of the first, useful for "most recent entry" lookups.
XLOOKUP excel example
Say column A holds order numbers, column B holds customer names and column C holds order totals. To find the total for the order number typed in F2:
=XLOOKUP(F2, A2:A100, C2:C100, "No such order")
To find the customer for the same order, only the return range changes:
=XLOOKUP(F2, A2:A100, B2:B100, "No such order")
Both ranges must be the same height. If one is A2:A100 and the other is C2:C101, you will get errors or wrong answers.

XLOOKUP excel formula with match mode
The fifth argument is the match mode. The options in Microsoft's documentation are:
- 0 for an exact match (the default)
- -1 for an exact match, or the next smaller item if none is found
- 1 for an exact match, or the next larger item if none is found
- 2 for a wildcard match, where * and ? stand for unknown characters
The "next smaller" option is handy for price bands and tax brackets, where you want the row that applies to a number between two thresholds.
XLOOKUP excel multiple criteria
XLOOKUP has no separate multi-column option, but you can combine conditions by multiplying them. This example finds the amount in column C where column A equals the value in F2 and column B equals the value in G2:
=XLOOKUP(1, (A2:A100=F2)*(B2:B100=G2), C2:C100, "No match")
Each comparison gives TRUE or FALSE, multiplying turns them into 1 or 0, and the formula looks for the first row where both are 1. Test it on a few rows you can check by eye before relying on it.
XLOOKUP vs VLOOKUP vs INDEX MATCH
INDEX with MATCH was the usual workaround for VLOOKUP's limits. It can look left and does not depend on column numbers. It works in every version of Excel and in Google Sheets, but it is longer and harder to read.
=INDEX(Products!C:C, MATCH(A2, Products!A:A, 0))
Use XLOOKUP when everyone who opens the file has a version that supports it. Use INDEX and MATCH when you must support older Excel.
XLOOKUP vs VLOOKUP vs HLOOKUP
HLOOKUP is VLOOKUP turned sideways. It searches across the top row of a table and returns a value from a row below. XLOOKUP replaces both: point it at a row range instead of a column range and it works horizontally too, with the same arguments.
XLOOKUP vs VLOOKUP in Google Sheets
Google Sheets also has XLOOKUP, and the basic form above uses the same argument order as Excel. Type =XLOOKUP in a cell and the formula help shows the arguments. If you move work between the two programs, see our free Google Sheets budget template for a ready-made sheet.
XLOOKUP excel mac and older versions
XLOOKUP is not in very old versions of Excel. Microsoft lists it for Microsoft 365, Excel 2021 and later, and Excel for the web, and it is available in Excel for Mac in those same editions. If you share files with people on Excel 2016 or 2019, they will see errors where the formula is. Check Microsoft's support page for XLOOKUP for your exact version. Keep VLOOKUP for old files that already work and do not change.
Common mistakes
- Mismatched ranges. Search and return ranges must be the same size.
- Stray spaces. A code with a trailing space will not match. Wrap the lookup value in TRIM if the data came from another system.
- Numbers stored as text. "1001" as text does not match 1001 as a number.
XLOOKUP vs VLOOKUP: related questions
Which is better, XLOOKUP or VLOOKUP?
XLOOKUP is easier to write and safer when columns change. VLOOKUP works in more versions of Excel. Pick the one your file and your readers can open.
What is the difference between XLOOKUP, VLOOKUP and HLOOKUP?
VLOOKUP searches down a column and HLOOKUP searches across a row. XLOOKUP can do both with one formula by changing the ranges.
Should I use XLOOKUP or INDEX MATCH?
Both can look left and neither uses column numbers. XLOOKUP is shorter. INDEX MATCH works in older versions of Excel.
The short answer
For new work, use XLOOKUP. Use INDEX and MATCH for older Excel, and leave existing VLOOKUPs alone unless the table layout keeps changing. Want to make your lookup results easier to read? See conditional formatting in Google Sheets based on another cell.


No comments:
Post a Comment