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

Workflow that saves evenings

  1. Duplicate the key column into a KeyClean helper.
  2. Apply TRIM + case normalization there (=UPPER(TRIM(A2))).
  3. Point lookups at KeyClean, not the raw import.
  4. 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:

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:

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

Excel practice hub · Free lessons · Blog