intermediate 3 min read

XLOOKUP Errors in Google Sheets: #N/A, #REF!, #VALUE!

Fix every XLOOKUP error in Google Sheets: #N/A not found, #N/A from mismatched ranges, #REF! blocked spills, and #VALUE! from missing ARRAYFORMULA.

SB

Sheets Bootcamp

July 28, 2026

Quick Answer

XLOOKUP has three errors: #N/A means not found OR mismatched range sizes, #REF! means a blocked spill, and #VALUE! usually means a missing ARRAYFORMULA wrapper. Quick fix for the most common one: =XLOOKUP(A2, B2:B50, C2:C50, "Not found") turns not-found into a friendly value.

XLOOKUP removes most of VLOOKUP’s failure modes, but it has a short error vocabulary of its own, and one of its errors has two very different causes. Every diagnosis below was reproduced in a live sheet before it went in this guide.

In This Guide

#N/A: Not Found

The honest error: the search key is not in the lookup range.

Formula
=XLOOKUP("SKU-999", A2:A6, D2:D6)

When the value should be there but XLOOKUP disagrees, the mismatch is almost always invisible formatting:

  • Stray spaces. "SKU-103 " with a trailing space does not equal "SKU-103". Clean with TRIM, or check with =LEN(cell) against the length you expect.
  • Numbers stored as text. A text "42" does not match a numeric 42. Text numbers align left by default; convert with VALUE, or re-enter the column with a number format.
  • Different characters that look alike. Data pasted from other tools can carry non-breaking spaces or curly quotes. Re-typing one failing key by hand tells you quickly whether the visible text is the real text.

When the key genuinely may be absent, that is not an error to fix but a case to handle: the missing_value argument exists for exactly this.

#N/A: Mismatched Range Sizes

The trap: XLOOKUP also fails with #N/A when the lookup range and result range are different sizes, even for a key that is right there in the range.

Formula
=XLOOKUP("Red", A2:A6, B2:B5)

Five lookup cells, four result cells: the formula returns #N/A despite β€œRed” sitting in A2. We verified this in a live sheet, and it is the most misleading error on this page because it impersonates a not-found result. If a lookup that must succeed returns #N/A (or your missing_value fallback), compare the two ranges’ sizes before anything else.

Tip

Write the two ranges with identical row numbers, like A2:A50 and D2:D50, and mismatches cannot happen. Ranges built by editing one endpoint later are how the sizes drift apart.

#REF!: The Blocked Spill

A multi-column result range spills its extra values into neighboring cells. If any of those cells holds data, nothing spills and the formula returns #REF!:

Formula
=XLOOKUP("SKU-103", A2:A6, B2:D6)

With anything typed two cells to the right, this shows #REF!. Clear the spill zone (the result range’s width minus one, to the right of the formula; for horizontal lookups, below it) and the values appear.

#REF! also appears for the ordinary reason any formula gets it: a range that no longer exists because its sheet or columns were deleted. If your formula references another sheet, check the sheet name still matches.

Note

Neither #REF! cause is caught by missing_value, which only handles not-found. #REF! always means structure, not data.

#VALUE!: The Missing ARRAYFORMULA

The Excel-import special. Excel evaluates array expressions inside XLOOKUP automatically, so its multiple-criteria pattern looks like this:

Formula
=XLOOKUP(1, (A2:A100="Dana")*(B2:B100="Pocket Watch"), C2:C100)

In Google Sheets, that exact formula returns #VALUE!. Sheets does not evaluate the elementwise comparison arrays unless the formula is wrapped in ARRAYFORMULA:

Formula
=ARRAYFORMULA(XLOOKUP(1, (A2:A100="Dana")*(B2:B100="Pocket Watch"), C2:C100))

We verified both behaviors live: bare fails with #VALUE!, wrapped returns the right row. The concatenation variant of the same trick fails as #N/A instead, which is stranger to debug; the full story is in XLOOKUP with multiple criteria.

A #VALUE! can also come from a search key that is itself an error (check the cell your formula points at), or from handing a 2-D block to the lookup_range, which must be a single row or column.

Wrong Value, No Error

The worst failure returns confidently and incorrectly. XLOOKUP has exactly two ways to do this, and both are opt-in:

  • An approximate match you did not mean. Match_mode -1 or 1 returns neighbors of missing keys by design. If a formula you inherited returns near-misses, look for a -1 or 1 in the fifth argument.
  • Binary search on unsorted data. Search_mode 2 and -2 assume sorted ranges and quietly break on unsorted ones. Remove the sixth argument unless the range is large and reliably sorted.

On default settings, exact match with a top-down scan, XLOOKUP does not return wrong rows silently. That is the single biggest reliability difference from VLOOKUP, whose approximate default made silent wrongness the out-of-the-box behavior.

Frequently Asked Questions

Why is my XLOOKUP returning #N/A in Google Sheets?
Either the search key is genuinely not in the lookup range, or the lookup and result ranges are different sizes, which also fails as #N/A. Check for typos, stray spaces, and numbers stored as text first, then confirm both ranges cover the same number of cells.
Why does XLOOKUP return #REF!?
Almost always a blocked spill: the result range spans several columns or rows, and the cells the extra values need to land in are not empty. Clear the spill zone and the error goes away. A deleted sheet or range in the formula also produces #REF!.
Why does XLOOKUP return #VALUE! in Google Sheets?
The most common cause is an Excel-style array formula pasted without ARRAYFORMULA, like the multiple-criteria pattern =XLOOKUP(1, (A:A=x)*(B:B=y), C:C). Google Sheets needs the whole formula wrapped in ARRAYFORMULA to evaluate the arrays.
Why does XLOOKUP return the wrong value with no error?
Check for a match mode or search mode you did not intend. Match_mode -1 or 1 returns neighbors of missing values by design, and binary search modes (2, -2) return unreliable results on unsorted data. On exact match with default search, XLOOKUP does not return wrong rows silently.
How do I stop #N/A from breaking my SUM?
Give the lookup a numeric fallback with the fourth argument: =XLOOKUP(A2, B:B, C:C, 0). SUM and AVERAGE then treat missing lookups as zero instead of erroring on #N/A.

You've googled this formula before. Probably more than once.

Basic Training is a free course inside a real Google Sheet that grades every formula the moment you press Enter. 7 lessons, about 40 minutes, and this loop ends.

Try the Sheet That Grades You

Free. No spam, ever.

Get Free Basic Training