Excel like a finance pro.
← The libraryPractice · 2 questions →
Text function
CODE
Returns the numeric code of the first character.
OccasionalDifficulty 1100 · ProficientUsage rank #132 of 520
When to use it
The ANSI code of the first character of a text.
The shape of it
- Syntax
=CODE(text)
Worked examples
A letter
=CODE("A") → 65
Uppercase A.
Lowercase
=CODE("a") → 97
Lowercase is 32 higher.
A space
=CODE(" ") → 32
A space, handy for spotting non-breaking spaces (160).
Worth knowing
- Diagnose invisible characters: CODE(MID(text,n,1)).
- UNICODE for characters beyond 255.
- CODE(RIGHT(text)) checks the last character.
Where it goes wrong
- Only the first character is examined.
- Empty text returns #VALUE!.
Related
Learn the moves here — or let Wauvel run them on your numbers.
Meet your AI CFO →One CFO-grade Excel tip a week
A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.