Your VLOOKUP or XLOOKUP is returning #N/A but the value is right there in the table. Paste the formula and a few sample rows into ChatGPT — it spots the trailing space, the type mismatch, or the missing match argument and gives you the exact fix.
I have a VLOOKUP / XLOOKUP that is returning #N/A. Here is the formula: [paste formula] The lookup value is in cell [e.g. A2] and its current value is [paste the actual value]. The lookup table is on sheet [name], columns [e.g. A to D]. Here are 3 rows from the lookup table around where the match should be: [paste rows] When I replace the cell reference with the value typed directly, the formula [works / still returns #N/A]. Please identify why the match is failing and give me the corrected formula.
I think my #N/A error is caused by a data type mismatch — my lookup value appears to be a number but the table column might store it as text (or vice versa). Can you rewrite my formula to handle this? [paste formula]
My formula is now working correctly. Can you wrap it in IFERROR so that when a value genuinely isn't found, the cell shows a dash "—" instead of #N/A? [paste formula]
=SUM(B2:B5) therefore also returns #N/A.=SUM(B2:B5) returns £100,000 while the two missing IDs remain visible for review.For VLOOKUP, check whether the fourth argument is FALSE. XLOOKUP uses exact match by default.
If two values look identical but do not match, check for spaces or data-type differences.
Replace the lookup-cell reference with a hardcoded value. If that version works, investigate the source data.
Include the formula, sample values, and the result of your manual test.
Use TRIM(), VALUE(), TEXT(), or an exact-match setting depending on the cause.
TRIM() function to remove leading and trailing spaces. For example, change =VLOOKUP(A2, D:F, 2, FALSE) to =VLOOKUP(TRIM(A2), D:F, 2, FALSE).