When XLOOKUP cannot find a match, it returns #N/A. If you would rather show nothing, or a short message, you can change that with one argument.
Use the if_not_found argument
Add the value you want as the fourth argument. To show a blank cell, use an empty pair of quotation marks:
=XLOOKUP(A2, Prices!$A$2:$A$100, Prices!$C$2:$C$100, "")
If A2 is not in the list, the cell looks empty. Other values work just as well. “Not listed” makes it clear that the item is missing, a 0 can be useful in a total, and a cell reference can point to a note that explains the gap.
Why the blank is not truly empty
Returning “” fills the cell with an empty text value. It looks blank, but Excel still treats it as something:
- ISBLANK returns FALSE for it.
- COUNTA counts it as a filled cell.
- Arithmetic on it can return #VALUE!. For example, =D2*2 fails if D2 holds “”.
If another formula relies on the cell, guard it first, such as =IF(D2="", "", D2*2). Functions such as SUM skip text, so simple totals are usually fine.
Use IFNA with other lookups
VLOOKUP and INDEX with MATCH have no if_not_found argument, and older versions of Excel do not have XLOOKUP at all. For these, wrap the lookup in IFNA:
=IFNA(VLOOKUP(A2, Prices!$A$2:$C$100, 3, FALSE), "")
IFNA hides only the #N/A error. Other errors still appear, so a broken range or a misspelled function name is not hidden.
Why not use IFERROR
IFERROR hides every error, not just a missing match. A #REF! from a deleted sheet or a #VALUE! from a bad calculation would show a blank with no warning. That can make a broken formula look like a list with gaps in it. IFNA limits the blank to the case you meant. For more on errors in general, see how to hide errors in excel formulas.
When a visible message is better
A blank cell can mean two things: the item is not on the list, or someone forgot to fill it in. If that difference matters, use a message such as “Not listed” or “Check code” so the gap is obvious. Use a blank when the sheet is for reading and missing items are expected, such as a summary where most rows are filled.
If you are unsure why a value is showing as an error at all, see what does #n/a mean in excel for the usual causes.