Fix XLOOKUP Returning Zero Instead of a Matching Value in Excel
Question details
Find out why an Excel XLOOKUP formula returns zero instead of the expected matching value.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user is looking up a value in an Allocations worksheet and returning a value from another column.
- Observed behavior
- The formula returns zero where the user expects a nonzero matching value.
Locate the lookup value, the expected matching row, and the return cell on the Allocations sheet. Check the existing formula's lookup range, return range, and optional not-found argument.
Test the Lookup and Check the Expected Return Cell
Use a separate formula to determine whether Excel finds a match and whether the source value is actually zero or blank.
An exact-match XLOOKUP normally returns #N/A when it finds no match unless the if_not_found argument specifies another result. A zero can also come from a matched cell that contains zero or is blank.
In an empty cell, enter =XLOOKUP($A298,Allocations!$A:$A,Allocations!F:F,"Not found",0). The final 0 requests an exact match.
Replace A2 with the expected row and enter =A298=Allocations!A2 in an empty cell. FALSE means the two values do not compare as equal.
On the Allocations sheet, check column F in the matched row. A genuine zero is returned as zero, and a blank return cell can also appear as zero in XLOOKUP.
Select the original formula and inspect its if_not_found argument in the formula bar. If it is set to 0, change it to a label such as "Not found" to distinguish a missing match from a returned zero.

Clean Lookup Keys and Resolve Text-Number Mismatches
Use this approach when the expected keys look alike but the comparison returns FALSE or the test lookup reports no match.
Align the Lookup and Return Ranges
Use this fix when the formula finds a key but returns a value from the wrong row or column.
Review Spreadsheet Lookups with WPS Office
WPS Office is a free, lightweight alternative for working with spreadsheets in a familiar interface. Open existing Excel files to review data and formulas while moving between Office workflows; it does not repair Excel itself.

Frequently Asked Questions
Why does XLOOKUP return zero for a blank cell?
When XLOOKUP finds a matching row but the return cell is blank, Excel can display the result as zero. Check the return cell directly to distinguish a blank from a genuine zero.
Should an unmatched XLOOKUP return zero?
Not by default. An unmatched XLOOKUP normally returns #N/A, but it returns zero if the formula's if_not_found argument is set to 0. Change that argument to "Not found" to make missing matches visible.
How can I tell whether two lookup values are the same?
Enter a comparison such as =A298=Allocations!A2, using the expected matching row. If the result is FALSE, compare LEN and TYPE results and look for spaces, hidden characters, or text-number differences.
Can lookup and return ranges start on different rows?
They should cover corresponding rows. For example, pair Allocations!$A$2:$A$1000 with Allocations!$F$2:$F$1000 so each lookup key aligns with its intended return value.




