A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
#N/A with VLOOKUP usually means Excel cannot find an exact match, even when the value appears to be there. For a case where only some rows are returned, check these in order:
- Use exact match in the formula.
- Set the 4th argument to
FALSEor0. - Example:
=VLOOKUP(A2,$A:$D,2,FALSE) - If that argument is
TRUEor omitted, the first column must be sorted, otherwise Excel can return wrong results or#N/A.
- Set the 4th argument to
- Make sure the lookup value exists in the first column of the lookup range.
-
VLOOKUPonly searches the first column of the selected table array. - If the value is in column B but the range starts at column A, the lookup can fail.
-
- Check for text vs number mismatches.
- A value can look the same but still not match if one side is stored as text and the other as a number.
- In Excel, select the cells, then use Format Cells > Number to make both sides the same type.
- If needed, apply the format to the full column, then use Data > Text to Columns > Finish.
- Remove extra spaces.
- Leading or trailing spaces can cause
#N/A. - Use
TRIMto clean the lookup data. - Example:
=VLOOKUP(D2,TRIM(A2:B7),2,FALSE)
- Leading or trailing spaces can cause
- Check the return column index.
- If
col_index_numis larger than the number of columns in the selected range, Excel returns#REF!. - If columns were inserted or deleted, confirm the index still points to the correct return column.
- If
- If the value truly may not exist, wrap the formula.
-
IFNAreturns a custom result only for#N/A. - Example:
=IFNA(VLOOKUP(A2,$A:$D,2,FALSE),"Not found") -
IFERRORcan also be used if a broader error handler is needed.
-
If the formula is showing as text instead of calculating, confirm the cell is not being treated as text, then re-enter the formula.
If available, XLOOKUP is the better option because it returns exact matches by default and is more flexible than VLOOKUP.
- Context # VLOOKUP function
- Context # How to correct a #N/A error
- Context # Quick Reference Card: VLOOKUP troubleshooting tips
- Context # IFNA function
- Context how do I fix my excel sheet when my xlookup is giving me #N/A which I know for sure it is incorrect. - Microsoft Q&A
- Context VLOOKUP formula is not working on a spreadsheet that used to work previously - Microsoft Q&A
- Context why is my vlookup returning #N/A when I can see the account is visible in the lookup worksheet? - Microsoft Q&A