XLOOKUP #N/A: Value Not in the List
XLOOKUP returns #N/A when the lookup value is not in the lookup array and the fourth argument, if_not_found, is left empty. The default match ignores capitalization. A space or a number stored as text is still a different value.
#N/AXLOOKUPXLOOKUP looks for lookup_value in lookup_array and returns the cell on the same row from return_array. With the default match mode, 0, the match is exact. If nothing matches and you did not supply if_not_found, the result is #N/A. Capital letters are not the cause. XLOOKUP is not case sensitive, so "Smith" matches "SMITH". A trailing space does not match. A number does not match the same digits stored as text. The green triangle Number Stored as Text shows that second case. The fourth argument replaces #N/A when the value is genuinely absent: =XLOOKUP(A2,D2:D100,E2:E100,"Not found"). IFNA does the same from outside the function and leaves other errors alone: =IFNA(XLOOKUP(A2,D2:D100,E2:E100),"Not found"). IFERROR hides #N/A and every other error, including #VALUE!. Two different sizes of lookup_array and return_array return #VALUE!, not #N/A. Match mode 1 or -1 does not need a sorted list: it returns the next larger or next smaller item. Search mode 2 or -2 is a binary search and does need a sorted lookup array. XLOOKUP is in Excel for Microsoft 365 and in Excel 2021. In Excel 2019 or earlier the same formula returns #NAME?, because the function is not there.
Why XLOOKUP causes #N/A
The value is not in the lookup array
Exact match is the default. If the value is absent and if_not_found is omitted, XLOOKUP returns #N/A. This is the normal result for a missing item, not a broken formula.
=XLOOKUP("Smith",A2:A100,B2:B100) when A2:A100 has no SmithThe value differs by a space or by its type
A trailing space, a non-breaking space, or a number stored as text fails an exact match. Capitalization does not. TRIM removes ordinary spaces from the value you look up.
=XLOOKUP(TRIM(A2),D2:D100,E2:E100,"Not found") when A2 is "E102 " and the list contains "E102"Approximate match has no neighbor
Match mode -1 returns the next smaller item, and match mode 1 returns the next larger item, without requiring a sort. If no such item exists, the result is #N/A unless if_not_found is set.
=XLOOKUP(5,A2:A10,B2:B10,"Not found",1) when every value in A2:A10 is smaller than 5 and you still want a fallbackStep-by-Step Solution
- 1Select the cell and read the lookup value, the lookup array, and the return array in the formula bar.
- 2Search that lookup array for the value (Ctrl+F). If it is absent, add a fourth argument: =XLOOKUP(A2,D2:D100,E2:E100,"Not found").
- 3If the value seems present, check for a trailing space and for text versus numbers. TRIM cleans ordinary spaces. A green triangle means the number is text: Convert to Number, or use VALUE on the side that should be numeric.
- 4Confirm both arrays have the same height and width. Different sizes return #VALUE!, not #N/A.
- 5If you use match mode 1 or -1, remember the list does not have to be sorted. Search mode 2 or -2 does require a sorted lookup array.
- 6If Excel does not recognize XLOOKUP at all, the result is #NAME?. The function is available in Excel for Microsoft 365 and Excel 2021, not in Excel 2019 or earlier.
Concrete Example
Employee id stored as text
A sheet looks up a salary from an employee id. The id typed in A2 is the number 1025. The id column was imported as text.
Before (error)
=XLOOKUP(A2,Payroll!A:A,Payroll!C:C)After (fixed)
=XLOOKUP(A2,Payroll!A:A,Payroll!C:C,"Not found")Problem: =XLOOKUP(A2,A:A,C:C) returns #N/A. The digits look the same, but a number does not exactly match text.
Solution: Convert the id column to numbers, or convert the lookup value to text if the list must stay text. Add if_not_found for ids that are truly missing.
Prevention Tip
Put the message for a missing value in the fourth argument, if_not_found, so a real absence stays visible and a typo in the formula does not get hidden by IFERROR.
Free Tools to Fix Your Formulas
Use these free tools to avoid this error:
Excel Formula Generator
Describe the calculation in plain English. This free Excel formula generator returns a formula you can copy into the sheet.
VLOOKUP Generator
Generate VLOOKUP formulas instantly by describing what you need in plain English
Excel Formula Explainer
Paste an Excel formula that starts with =. This free tool explains what the formula is doing, in plain language.