Hands-On Excel

Hands-On Excel Challenges Fixing #N/A

VLOOKUP not working? Fix the #N/A

When VLOOKUP shows #N/A for a value you can see in the table, either the value isn't an exact match or it isn't inside the table range. Lock the whole table and clean the value: =VLOOKUP(TRIM(A2), $D$2:$E$8, 2, FALSE).

CoreAbout 3 minutesFree, no sign-upBy Updated

Try it yourself

16 · Fixing #N/A · Core

Mistake hunt: #N/A everywhere

Every item in column A is on the price list, but three prices show #N/A. Fix the formulas in column B so every item gets its price. You can't edit the items, so the fix goes in the formula.

Click a #N/A cell and look at the colored range: is the item inside the table? Then look at the item itself: a space you can't see still counts. TRIM removes it, and $ stops the table from sliding.

order.xlsx
Ready

Write in the green cells, then press Check. Click a cell while typing to insert it, drag to select a range, F4 adds $, Esc cancels.

The guide · Fixing #N/A

The checklist

CauseHow to spot itFix
A space at the end of the value=LEN(A4) is one more than you expectTRIM(A4) in the lookup
The table slid when the formula was copiedLower rows search a table that starts lower downLock it: $D$2:$E$8
The table stops before the last rowA newly added item is below the rangeExtend the range to the end of the list
A number stored as textThe value sits on the left of the cell, often with a green triangleConvert it, or look up VALUE(A2)
The value isn't in the first columnThe table starts to the right of the lookup columnStart the table at the lookup column, or use XLOOKUP

How to look

Click a cell that shows #N/A and look at the formula bar. Excel colors each reference and outlines the same range on the sheet. Is the item you're looking for inside the outlined table? If yes, compare the two values character by character: =A4=D5 returns FALSE when they differ by an invisible space.

Why the first row works and the others don't

A formula written in B2 with D2:E7 and filled down becomes D3:E8, D4:E9, and so on. Each row searches a smaller slice of the price list, so the items near the top of the list stop being found. The fix is dollar signs, not a bigger range.

Common mistakes

FAQ

Why does VLOOKUP return #N/A when the value exists?
The value doesn't match exactly, often because of a space at the end or a number stored as text, or the value is outside the table range, often because the range moved when the formula was copied.
How do I remove spaces in a VLOOKUP?
Wrap the lookup value in TRIM: =VLOOKUP(TRIM(A2),$D$2:$E$8,2,FALSE). TRIM removes spaces at the start and end and doubles in the middle.
Why does VLOOKUP work in the first row but not when I copy it down?
The table range isn't locked, so it moves down one row with every copy. Add dollar signs: $D$2:$E$8.
How do I fix VLOOKUP with numbers stored as text?
Make both sides the same type. Convert the text numbers to numbers (for example with VALUE or by multiplying by 1), or convert the lookup value with TEXT if the table holds text.

All challenges

  1. 01 Add it upSUM Starter · 3 min
  2. 02 Find the averageAVERAGE Starter · 3 min
  3. 03 Write once, fill downRelative references Starter · 3 min
  4. 04 Lock it with $Absolute references Core · 3 min
  5. 05 Percent of a totalPercentages Starter · 3 min
  6. 06 Select to the end in one moveCtrl + Shift + arrow Core · 3 min
  7. 07 Pass or fail?IF Core · 3 min
  8. 08 Count the ones that matchCOUNTIF Core · 3 min
  9. 09 Add up with two conditionsSUMIFS Core · 3 min
  10. 10 Look it upVLOOKUP Core · 3 min
  11. 11 Find the right bracketVLOOKUP approximate match Core · 3 min
  12. 12 XLOOKUP, the modern wayXLOOKUP Core · 3 min
  13. 13 INDEX and MATCH togetherINDEX + MATCH Advanced · 3 min
  14. 14 Catch the error, not the bugIFERROR Core · 3 min
  15. 15 Split first and last namesLEFT, MID + FIND Core · 3 min
  16. 16 Mistake hunt: #N/A everywhereFixing #N/A Core · 3 min

Pro · coming soon

From first formula to job-ready.

100+ challenges on lookups, pivot tables, dates and text cleanup, an interview track modeled on the Excel tests employers use, and your progress saved across devices.

$29 one-time · early-bird price

You won't be charged today.

You're early!

Pro isn't open yet. We're building it right now. Leave your email and we'll hold the $29 early-bird price for you and tell you the day it launches.

We'll email you a link to confirm, then one email when Pro launches. Privacy