TRUECALC
Functions

CODE

Numeric code of first character

Try it

When to use it

When should I use CODE?

Use CODE when you need the numeric character code of the first character in a string — for example, to detect whether a cell starts with an uppercase letter, a digit, or a special character, or to build character-range validation logic.

Used in

operations

Syntax

CODE(text)

Examples

=CODE("a") // => 97
=CODE("A") // => 65
=CODE("ABC") // => 65

On this page