Clean text before you look it up
Most #N/A disasters are dirty text—spaces, case, and split names—not “broken” VLOOKUP. Practice TRIM, VALUE, and helper-key workflows.
You write a perfect exact-match lookup and still get #N/A. Nine times out of ten the keys do not match as text: trailing spaces, West vs West, mixed case in imported IDs, or first/last names stuck in one cell. Clean first; then look up. Error decode: common Excel errors.
Cleanup toolkit
- TRIM — remove extra spaces (not non-breaking spaces from some exports)
- UPPER / LOWER / PROPER — normalize keys before matching — change case
- SUBSTITUTE — strip dashes or odd symbols — SUBSTITUTE
- TEXTBEFORE / TEXTAFTER — split names and codes in modern Excel — TEXTBEFORE, TEXTAFTER
- LEFT / MID / RIGHT / FIND — legacy splitting — LEFT, MID, FIND
- VALUE — coerce numbers stored as text when totals or lookups fail
- LEN — spot invisible characters when two cells “look” identical — LEN
Workflow that saves evenings
- Duplicate the key column into a
KeyCleanhelper. - Apply
TRIM+ case normalization there (=UPPER(TRIM(A2))). - Point lookups at
KeyClean, not the raw import. - Only then build XLOOKUP / VLOOKUP / SUMIFS on top.
Exercise 1 — trailing space
A2 shows Ada but was typed as Ada (trailing space). Table names are clean. Exact XLOOKUP on A2 returns #N/A.
Fix: =XLOOKUP(TRIM(A2), $H$2:$H$100, $I$2:$I$100) Or clean into a helper: =TRIM(A2) in B2, then look up B2.
Exercise 2 — number stored as text
EmpID 101 is text in the order sheet ('101) and numeric in the staff table.
Fix options:
=VLOOKUP(VALUE(E2), $A$2:$D$50, 2, FALSE)- Or clean the ID column once with Text to Columns / multiply by
1
Practice the lookup side: VLOOKUP exercises.
Exercise 3 — split full name
A2 is Ada Lovelace. Put first name in B2, last name in C2 (modern Excel).
Answer:
=TEXTBEFORE(A2," ")=TEXTAFTER(A2," ")
Legacy: =LEFT(A2,FIND(" ",A2)-1) and a MID/RIGHT pair. Guides: extract first word, extract last word.
Exercise 4 — normalize before SUMIFS
Region column has west, West, WEST. Criteria cell says West. Totals look random.
Fix: helper =UPPER(TRIM(F2)), criteria WEST, or normalize both sides the same way. Multi-criteria drills: SUMIFS practice problems.
Exercise 5 — interview narration
“Most #N/A is dirty keys. I TRIM and align types before I rewrite the lookup.” That sentence plus a live fix beats naming ten functions. More: Excel interview questions.
Practice in the product
- Lookups after cleanup: XLOOKUP practice, XLOOKUP guide
- Text hub: /functions (Text category)
- CONCAT / TEXTJOIN when rebuilding keys: CONCAT, TEXTJOIN