Almost every workbook I am asked to fix has lookups in it, and a surprising number of the bugs come from picking the wrong lookup formula or using the right one with the wrong defaults. This guide compares XLOOKUP vs VLOOKUP, plus the classic INDEX MATCH combination, using the same small dataset for all three. By the end you will know exactly how each one works, which Excel versions support it, where each one fails, and which to choose for your own files.
All examples use a product list in A1:D100 with these headers: ProductID (A), Name (B), Category (C) and Price (D). The ID you want to look up is in G2.
The same lookup written three ways
Here is the most common task, finding the price for a product ID, written with each formula:
VLOOKUP: =VLOOKUP(G2, A2:D100, 4, FALSE)
INDEX MATCH: =INDEX(D2:D100, MATCH(G2, A2:A100, 0))
XLOOKUP: =XLOOKUP(G2, A2:A100, D2:D100, "Not found")
All three return the same price. The differences show up when the data changes, when the value is missing, or when the file is opened by someone on an older version of Excel.
How VLOOKUP works
VLOOKUP searches the first column of a block of cells and returns a value from a column number you specify. In the example, 4 means “the fourth column of A2:D100”, which is Price. The last argument, FALSE, asks for an exact match. VLOOKUP has been in every version of Excel and Google Sheets for decades, which is its biggest strength.
How INDEX MATCH works
This is two functions working together. MATCH finds the position of G2 inside A2:A100 (for example, row 17 of that range). INDEX then returns the 17th value from D2:D100. Because the lookup column and the return column are separate ranges, the return column can sit anywhere, including to the left of the lookup column. The 0 in MATCH means exact match.
How XLOOKUP works
XLOOKUP takes a lookup value, the column to search, and the column to return, much like INDEX MATCH in one function. It also has optional arguments for a not-found message, the match type and the search direction. It defaults to an exact match, which removes the most common VLOOKUP trap. You can read the full argument list in Microsoft’s XLOOKUP function reference.
XLOOKUP vs VLOOKUP vs INDEX MATCH compared
| Feature | VLOOKUP | INDEX MATCH | XLOOKUP |
|---|---|---|---|
| Excel versions | All | All | Excel 365, 2021, 2024, Excel for the web |
| Google Sheets | Yes | Yes | Yes |
| Default match type | Approximate (risky) | Approximate (risky) | Exact |
| Look to the left | No | Yes | Yes |
| Survives inserted columns | No, column number is fixed | Yes | Yes |
| Built-in not-found value | No, needs IFNA | No, needs IFNA | Yes |
| Search from the bottom | No | No (needs a workaround) | Yes |
| Return several columns at once | No | No | Yes, results spill |
Notice that MATCH, like VLOOKUP, defaults to approximate match if you leave out the last argument. Both will quietly return a wrong answer from unsorted data instead of an error. That is why I always type the FALSE or 0 even when I think I do not need it.
Real-world lookups where the differences matter
Looking up to the left
Suppose you have a product name in G3 and need its ID, which sits in column A, to the left of Name. VLOOKUP cannot do this without rearranging the data. The other two can:
=INDEX(A2:A100, MATCH(G3, B2:B100, 0))
=XLOOKUP(G3, B2:B100, A2:A100)
Two-way lookup (row and column)
For a grid like monthly sales, with product IDs down column A and month names across B1:M1, you need to match both a row and a column. Here G2 holds the ID and H1 holds the month:
=INDEX(B2:M100, MATCH(G2, A2:A100, 0), MATCH(H1, B1:M1, 0))
=XLOOKUP(G2, A2:A100, XLOOKUP(H1, B1:M1, B2:M100))
The inner XLOOKUP returns the whole month column, and the outer one picks the row from it.
Lookup with two conditions
To find the price where ID is G2 and Category is H2, multiply two true/false tests and look for 1:
=XLOOKUP(1, (A2:A100=G2) * (C2:C100=H2), D2:D100, "No match")
=INDEX(D2:D100, MATCH(1, (A2:A100=G2) * (C2:C100=H2), 0))
In Excel 365 and 2021 both work as typed. In Excel 2019 and earlier, the INDEX MATCH version must be entered with Ctrl+Shift+Enter as an array formula.
Finding the latest entry
If a price list has several rows per product and the newest is at the bottom, XLOOKUP can search from the last row up by setting the search mode to -1:
=XLOOKUP(G2, A2:A100, D2:D100, "Not found", 0, -1)
Returning several columns at once
In Excel 365, =XLOOKUP(G2, A2:A100, B2:D100) returns Name, Category and Price into three adjacent cells. Keep the cells to the right empty, or you will get a #SPILL! error.
Which lookup formula should you use?
My rule of thumb after years of building client workbooks:
- Use XLOOKUP when everyone who opens the file has Excel 365, Excel 2021 or later, or uses Google Sheets. It is shorter, safer by default and easier for the next person to read.
- Use INDEX MATCH when the file goes to clients, suppliers or colleagues who might still be on Excel 2016 or 2019. It does everything important that XLOOKUP does and works everywhere.
- Use VLOOKUP for quick, throwaway lookups on data you control, always with
FALSEat the end. Avoid it in models other people will edit, because one inserted column can silently break it.
If a file with XLOOKUP is opened in Excel 2019 or earlier, the cells show #NAME? as soon as the workbook recalculates. If you are not sure what version your audience uses, INDEX MATCH is the safe choice.
For bigger reference models, such as the sales, purchase and inventory model in my portfolio, I usually use lookups against Excel Tables with structured references, for example =XLOOKUP([@ProductID], tblProducts[ProductID], tblProducts[Price]). The ranges grow automatically when new products are added.
Common lookup mistakes
- Leaving out the match type. VLOOKUP without FALSE and MATCH without 0 use approximate match and can return the wrong row without any error.
- Numbers stored as text. An ID of 1001 typed as text will not match 1001 as a number. Look for small green triangles, or convert with Data, Text to Columns, Finish.
- Hidden spaces. “ACME ” with a trailing space does not match “ACME”. Clean the data with TRIM before looking it up.
- Ranges of different sizes. In XLOOKUP and INDEX MATCH, the lookup and return ranges must have the same number of rows.
- Hiding every error with IFERROR. Use IFNA or the XLOOKUP not-found argument, so real errors such as
#REF!still show up.
Frequently asked questions
Is XLOOKUP faster than VLOOKUP?
For typical business files of a few thousand rows, you will not notice a difference. On very large sorted lists, XLOOKUP’s binary search mode (search mode 2) is noticeably quicker than a normal exact match.
Does XLOOKUP support wildcards?
Yes, but not by default. Set the match mode argument to 2, for example =XLOOKUP("*"&G2&"*", B2:B100, D2:D100, , 2). VLOOKUP with FALSE and MATCH with 0 accept wildcards automatically.
Should I replace all my VLOOKUPs with XLOOKUP?
Only if everyone using the file has a version that supports it and the VLOOKUPs are causing problems. Working formulas in a stable file are usually best left alone.
Want your workbook cleaned up?
If you have a workbook full of fragile lookups, slow formulas or #N/A errors, I can rebuild it into something reliable through my Excel automation service. Get an instant quote, or try the free calculators on my tools page first.
