Forum Discussion
XLOOKUP returning #N/A for some values when the values are there
I'm late to this discussion but leaving this for anyone that like me has the same problem and goes looking for answers like I did yesterday 9/18/2025.
My XLOOKUP was failing. I used trim to get rid of leading & trailing spaces. I could search the 2 sheets using find for a specific word/data in each and find them just fine but XLOOKUP continued to fail. I ended up copying the 2 columns involved into a blank spreadsheet. Again I could use Find and it would see it in the 1st column and again in the 2nd. XLOOKUP still failed. So in a 3rd column I did =EXACT(A1,B1) and it returned a false on each line. After running that the first column widened verically and it became easy to see the data in colum A was at the top of the cell and the data in B was at the bottom. Every cell in Column A had a carriage return from the way it had been pulled from another source. I used Find & Replace All to remove the carriage return and XLOOKUP worked fine. It took me 30 minutes to figure this out so I thought I'd leave this in case someone else ever has the same issue.