Help Centre › Functions & Formulas
For a full list of available calculation functions, please read What calculation functions are supported.
Description
The CODE function is used to find the numeric code of the first character in a text string. This function is particularly useful when you need to understand how characters are represented in the computer's character set.
Syntax
CODE(text)
The CODE function syntax has the following arguments:
- Text Required. The text string from which you want to extract the numeric code of the first character.
Example
| Formula | Description | Result |
| =CODE("A") | Returns the numeric code for the character "A". | 65 |
| =CODE("!") | Returns the numeric code for the character "!". | 33 |
| =CODE({variable}) | Assuming {variable} contains "Hello", this returns the numeric code for "H". | 72 |
Errors
For a full list of formula errors, please read Formula errors.