If your version of Excel does not have XLOOKUP, you can get the same result with INDEX and MATCH, with VLOOKUP for simple left-to-right lookups, or with LOOKUP for the last-match case. XLOOKUP only exists in Microsoft 365, Excel 2021 and later, and Excel for the web, so anyone on Excel 2019, 2016, 2013 or an older perpetual licence simply will not see it in the function list. Nothing is broken: those versions were shipped before the function existed and they will never receive it. The fix is to build the lookup with older functions that are supported everywhere.

One quick check before you start: type =XLOOKUP( in an empty cell. If Excel shows a tooltip and the formula completes, you have it and the problem is something else, such as a typo or a comma instead of a semicolon in a regional setup. If the text stays plain and you get #NAME? on Enter, you are on a version without it. Also confirm the file format: an .xlsx file opened in an old Excel still cannot use newer functions, and a file saved by a colleague in a newer version will show #NAME? for XLOOKUP when you open it on an older machine.

What You'll Need

  • Any version of Excel on Windows or Mac, including Excel 2016, 2019 and Excel for the web.
  • A table with a lookup column and a column containing the value you want back.
  • Familiarity with cell references and absolute references (the $ signs).
  • Optionally, a helper column if you need to look up to the left, or want the second or third match rather than the first.

Step-by-Step

  1. Identify your lookup value, lookup range and return range. Suppose the product code you are searching is in A2:A100, the product name is in B2:B100 and the price is in D2:D100. You want the price for the code typed in F2. Write these three ranges down before touching a formula; most lookup errors come from mismatched ranges rather than wrong functions.
  2. Use INDEX and MATCH for a flexible replacement. In the result cell enter =INDEX($D$2:$D$100,MATCH($F$2,$A$2:$A$100,0)). MATCH finds the row position of the code inside the lookup range; INDEX returns the value at that position in the return range. The third argument of MATCH, 0, means exact match, so always include it. This works left, right, up or down and is the closest one-for-one swap for XLOOKUP.
  3. Use VLOOKUP only when the return column is to the right. If price sits in column D and the code is in column A, =VLOOKUP($F$2,$A$2:$D$100,4,FALSE) returns column 4 of that block. The 4 is the column number counted from the first column of the range, not the worksheet column letter, which is the single most common source of wrong results. FALSE forces an exact match.
  4. Return a blank or message instead of #N/A. XLOOKUP has a built-in not-found argument; the older functions do not. Wrap the formula: =IFERROR(INDEX($D$2:$D$100,MATCH($F$2,$A$2:$A$100,0)),"Not found"). IFERROR is available from Excel 2007 onward. Be aware it also hides real errors such as #VALUE!, so use it after you have confirmed the formula works.
  5. Look up to the left without rearranging your data. This is where VLOOKUP fails and INDEX/MATCH wins. If the search value is in column D and you need the name from column B, write =INDEX($B$2:$B$100,MATCH($F$2,$D$2:$D$100,0)). Do not move columns around to satisfy VLOOKUP; it breaks other formulas and formatting.
  6. Get the last match rather than the first. XLOOKUP can search from the bottom; the older alternative is =LOOKUP(2,1/($A$2:$A$100=$F$2),$D$2:$D$100). It returns the value from the final row that matches, which is useful for logs and transaction histories where the newest entry matters. It works on sorted and unsorted data alike.
  7. Do an approximate or banded lookup. For tax bands, commission tiers or grades, sort the threshold column ascending and use =VLOOKUP($F$2,$A$2:$B$100,2,TRUE), or INDEX/MATCH with 1 as the third argument instead of 0. Approximate match returns the largest value less than or equal to your search value, so the thresholds must be in ascending order or the result will be wrong.
  8. Check the result against a known row. Pick a row you can verify by eye, type its code, and confirm the returned value. Then test a code that does not exist and confirm you get your chosen message rather than #N/A. Fill the formula down with the fill handle and make sure every range is locked with $ so the references do not drift as you copy.
  9. Consider dynamic array functions if you have them. If INDEX/MATCH works but XLOOKUP does not, check for FILTER and UNIQUE by typing =FILTER(. In some builds these arrived separately from XLOOKUP, and FILTER can return all matching rows at once. If FILTER is also missing, your version predates dynamic arrays entirely and the classic functions above are the correct path.

Common Mistakes

Leaving out the third MATCH argument or typing TRUE in VLOOKUP's fourth argument turns an exact lookup into an approximate one, which silently returns plausible but wrong values instead of an error. Ranges of different sizes are the second culprit: if the lookup range is A2:A100 and the return range is D2:D99, INDEX will point one row too high or low near the end. Dragging a formula without $ signs is the third, because ranges shift down as the formula copies down.

Other frequent problems include counting VLOOKUP's column index from column A of the sheet instead of from the first column of the lookup range, leaving trailing spaces in the search cell so an exact match fails, and storing numbers as text in one column and as real numbers in the other. If your code cell shows a green triangle or is left-aligned while the source column is right-aligned, that mismatch alone will produce #N/A.

Tips

Give your table a defined name (Formulas > Define Name) and use it in formulas, so ranges expand when you add rows and the formula reads clearly. Convert the data to an Excel Table with Ctrl+T; structured references then grow automatically. Keep the search cell formatted the same way as the source column, using Text to Columns or TRIM and VALUE to clean stray spaces and text-formatted numbers before matching.

If you regularly share files with people on newer Excel, keep to INDEX/MATCH so the workbook opens cleanly everywhere. And when you finally upgrade to Microsoft 365, the existing formulas keep working; there is no need to rewrite them unless you specifically want XLOOKUP's built-in if-not-found argument.

Troubleshooting

If you get #NAME?, Excel does not recognise the function name, which for XLOOKUP means the version does not support it. For INDEX/MATCH, #NAME? usually means a misspelled function or a missing quote around a text criterion. If you get #N/A, the lookup value genuinely is not in the range: check for spaces, text-versus-number formatting, hidden characters and accidental leading apostrophes.

If you get #REF!, the return range is shorter than the lookup range or a reference has been deleted. If the formula returns the wrong row's value, the ranges are almost certainly offset by a row. Press Ctrl+` (the grave accent key) to show all formulas on the sheet and compare them side by side, then press it again to hide them. If a formula works in one cell but fails when filled down, inspect the $ signs. If nothing resolves it, copy the working formula's text into a scratch cell and rebuild it one argument at a time.

Frequently Asked Questions

Can I add XLOOKUP to Excel 2019 or 2016?

No. XLOOKUP is built into the application, not an add-in, and older perpetual versions do not receive it. The only route is Microsoft 365, Excel 2021 or later, or Excel for the web; otherwise use INDEX and MATCH.

Does INDEX and MATCH do everything XLOOKUP does?

For lookups, effectively yes, including left lookups and exact or approximate matching. It lacks the built-in if-not-found argument, so wrap it in IFERROR, and it takes two functions instead of one.

Why does XLOOKUP show #NAME? in a file from a colleague?

The file was created in a newer Excel that has the function. On your older version, #NAME? appears because the function does not exist here. Ask for the values to be pasted as results, or replace the formula with INDEX and MATCH.

Is VLOOKUP still safe to use?

Yes, for simple lookups where the return column is to the right of the key. It is less flexible than INDEX and MATCH and breaks if columns are inserted inside the range, so many people prefer the latter for anything that will be edited.

Why does my exact-match lookup return the wrong value?

The most likely cause is an approximate match because 0 or FALSE was omitted, or because the ranges are different sizes. Check both before changing anything else.