ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Errors & fixes
  3. XLOOKUP Not Working? Causes and Fixes

XLOOKUP Not Working? Causes and Fixes

By ExcelReady Team·Updated November 1, 2026·6 min read

The short answer

XLOOKUP fails for a few clear reasons. #NAME? means your Excel version doesn't have it (it needs Microsoft 365 or Excel 2021 or later). #N/A means the value wasn't found, often because of spaces or text vs numbers. #VALUE! means the lookup and return ranges are different sizes. Add a fourth argument such as "Not found" to handle missing values.

Key takeaways

  • XLOOKUP only exists in Microsoft 365, Excel 2021, Excel 2024 and Excel for the web; older versions show #NAME?.
  • The fourth argument, if_not_found, replaces #N/A with your own message.
  • The lookup array and return array must have the same number of rows, or XLOOKUP returns #VALUE!.
  • Wildcards like "C*" only work when match_mode is 2.
  • XLOOKUP returns the first match; set search_mode to -1 to get the last one.
On this page+
  1. XLOOKUP errors at a glance
  2. #NAME?: your Excel doesn't have XLOOKUP
  3. #N/A: the value wasn't found
  4. How to show a message instead of #N/A
  5. #VALUE!: the ranges are different sizes
  6. #SPILL!: the result has no room
  7. Wrong value: wildcards, match mode and duplicates
  8. Practise it

When XLOOKUP is not working, the error it shows tells you most of what you need to know. #NAME? points to your Excel version, #N/A to the data, and #VALUE! to the ranges. This guide goes through each error and the quieter problems, like wildcards that don't match and duplicates that return the wrong row, with a fix for every one.

XLOOKUP errors at a glance#

Start with the error in the cell. Each one has a small set of causes:

What you seeMost likely causeFix
#NAME?Excel version without XLOOKUP, or a typoUse Microsoft 365 / Excel 2021+, or INDEX MATCH
#N/AValue not found: spaces, text vs numbers, typoClean the data; add if_not_found
#VALUE!Lookup and return ranges are different sizesMake the ranges match
#SPILL!The result needs more cells than are freeClear the cells next to the formula
Wrong valueWildcards, match mode or duplicatesSet match_mode or search_mode

The full syntax, for reference:

Excel formula
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

The examples use this product list in A1:C7:

ABC
1CodeProductPrice
2A-100Desk250
3A-101Chair120
4B-200Lamp45
5B-201Shelf180
6C-300Monitor210
7C-301Mouse25

=XLOOKUP("B-200",A2:A7,C2:C7) returns 45. The guide to using XLOOKUP covers the basics.

#NAME?: your Excel doesn't have XLOOKUP#

XLOOKUP is available in Microsoft 365, Excel 2021, Excel 2024 and Excel for the web. Excel 2019, 2016 and older don't have it. If you open a file with XLOOKUP in an older version, the formula shows #NAME?, and the formula bar may show _xlfn.XLOOKUP.

Check your version under File > Account (Mac: Excel > About Excel). If people who share the file use older Excel, use INDEX MATCH instead, which works everywhere:

Excel formula
=INDEX(C2:C7,MATCH("B-200",A2:A7,0))

If your version is new enough, #NAME? usually means a typo, such as XLOOKUP spelled wrong or text without quotes. The INDEX MATCH vs XLOOKUP comparison helps you choose.

#N/A: the value wasn't found#

#N/A means XLOOKUP looked through the whole lookup array and found no exact match. Sometimes that's correct: the code really isn't there. Often, though, the value is there but doesn't match exactly:

  • Extra spaces. "B-200 " with a trailing space doesn't match "B-200". Check with =LEN(A4), and clean the column with TRIM.
  • Text vs numbers. The number 1004 and the text "1004" are different. Convert the column with Convert to Number, or adjust the lookup value: E2&"" makes it text and VALUE(E2) makes it a number.
  • Typos and look-alike characters, such as a letter O instead of a zero.

These causes are the same for every lookup function. See VLOOKUP not working and INDEX MATCH not working for more examples.

How to show a message instead of #N/A#

XLOOKUP has a built-in fourth argument, if_not_found, for values that are genuinely missing:

Excel formula
=XLOOKUP("D-400",A2:A7,C2:C7,"Not found")

There's no code D-400, so the result is Not found instead of #N/A. You can return text, "" for a blank, or a number such as 0. This is better than wrapping the formula in IFERROR, because it only handles "not found" and still shows real errors like #VALUE!. The article on XLOOKUP if not found has more patterns.

#VALUE!: the ranges are different sizes#

The lookup array and the return array must have the same number of rows (or columns, for a horizontal lookup). If they don't, XLOOKUP returns #VALUE!:

Excel formula
=XLOOKUP("B-200",A2:A7,C2:C6)

A2:A7 has six rows and C2:C6 has five. Fix it to C2:C7. This often happens after you add rows and only update one range. Turning the data into an Excel table (Windows: Ctrl+T; Mac: ⌘T) and using its column names keeps both ranges the same size automatically.

#SPILL!: the result has no room#

XLOOKUP can return more than one cell. If the return array has several columns, such as B2:C7, it returns both Product and Price side by side. If you give it several lookup values, such as E2:E4, it returns several results down the column. Those results spill into neighbouring cells, and if any of them already hold something, you see #SPILL!.

Clear the cells the result needs, or return a single column. Also avoid whole-column references like A:A as the lookup value: that asks for over a million results.

Wrong value: wildcards, match mode and duplicates#

Sometimes XLOOKUP returns a value, just not the one you wanted.

Wildcards need match_mode 2. By default, * and ? are normal characters, so "C*" looks for the literal text C*. Set the fifth argument to 2:

Excel formula
=XLOOKUP("C*",A2:A7,B2:B7,,2)

This returns Monitor, the first code starting with C. The two commas leave if_not_found empty.

Approximate match needs match_mode -1 or 1. For tier tables like tax bands, -1 returns the next smaller value and 1 the next larger. Leave it out and XLOOKUP only does exact matches, so a value between tiers gives #N/A.

Duplicates return the first match. If a code appears twice, XLOOKUP returns the first one from the top. Set the sixth argument, search_mode, to -1 to search from the bottom and get the last match. Don't use search_mode 2 or -2 (binary search) unless the data is sorted, because on unsorted data it can return wrong results.

The XLOOKUP function guide lists every match_mode and search_mode value.

Practise it#

Practise XLOOKUP in a live spreadsheet: you'll write exact lookups, add an if_not_found message and look to the left, with each formula checked instantly. Then fix broken formulas in the lookup errors lesson to practise spotting #N/A and #VALUE! causes. Start with the exercise on this page.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Code D-400 in E2 isn't in the list, so a plain XLOOKUP shows #N/A. Click F2 and look up E2 in A2:A7, return the price from C2:C7, and add "Not found" as the fourth argument. Press Enter.

fx
ABCDEFG
1
Code
Product
Price
Find code
Price
2
A-100
Desk
250
D-400
3
A-101
Chair
120
4
B-200
Lamp
45
5
B-201
Shelf
180
6
C-300
Monitor
210
7
C-301
Mouse
25
8
9
10

Tip: Four parts: what to find, where to look, what to return, and the message if it's missing.

Practise this in a lesson

LessonXLOOKUPLook up in any direction with XLOOKUP and show a friendly message when nothing matches.LessonFixing lookup errorsDiagnose #N/A, #REF! and silent wrong answers in lookups, then handle missing items gracefully.Function guideXLOOKUPXLOOKUP explained with real examples: exact matches, looking left and custom not-found messages, plus a live exercise to try now.

Frequently asked questions

Why is XLOOKUP not available in my Excel?

+

XLOOKUP is only in Microsoft 365, Excel 2021, Excel 2024 and Excel for the web. In Excel 2019 or older, the formula shows #NAME?. Use INDEX MATCH or VLOOKUP there instead.

Why is XLOOKUP returning #N/A?

+

It couldn't find the lookup value. Check for extra spaces, numbers stored as text, or a typo. Add a fourth argument such as "Not found" to show a message instead of the error.

Why does XLOOKUP return #VALUE!?

+

The lookup array and the return array are different sizes, for example A2:A7 and C2:C6. Make both ranges cover exactly the same rows.

How do I use wildcards in XLOOKUP?

+

Set the fifth argument, match_mode, to 2. For example, =XLOOKUP("C*",A2:A7,B2:B7,,2) finds the first code starting with C. Without the 2, the asterisk is treated as a normal character.

Sources

  • XLOOKUP function - Microsoft Support
  • How to correct a #NAME? error - Microsoft Support
  • How to correct a #SPILL! error - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. XLOOKUP errors at a glance
  2. #NAME?: your Excel doesn't have XLOOKUP
  3. #N/A: the value wasn't found
  4. How to show a message instead of #N/A
  5. #VALUE!: the ranges are different sizes
  6. #SPILL!: the result has no room
  7. Wrong value: wildcards, match mode and duplicates
  8. Practise it

Keep reading

Lookups· 6 min read

XLOOKUP If Not Found: Show a Message Instead of #N/A

XLOOKUP has a built-in fourth argument, if_not_found, that replaces #N/A when no match exists. Write =XLOOKUP(F2,A2:A6,C2:C6,"Not found") to show a message. Use "" for a blank, 0 for zero, or another XLOOKUP as a backup search. It only catches missing values, so other errors still show, which helps you spot real mistakes.

Errors & fixes· 6 min read

INDEX MATCH Not Working? 7 Causes and Fixes

INDEX MATCH usually fails because MATCH is missing its 0 for an exact match, the INDEX and MATCH ranges don't start on the same row, or the lookup value and the data don't match exactly (text vs numbers, extra spaces). Write it as =INDEX(C2:C7,MATCH(E2,A2:A7,0)), with both ranges the same size, and lock them with $ before copying.

Lookups· 6 min read

VLOOKUP Not Working? 8 Causes and Fixes

When VLOOKUP is not working, the usual causes are a missing FALSE for exact match, extra spaces, numbers stored as text, a lookup value that isn't in the first column, or a table range that shifts when copied. Check each one in turn. TRIM fixes spaces, $ signs lock the range, and IFNA handles values that are truly missing.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free