Calc CODE function

The CODE function is used to find the numeric code of the first character in a text string.

Help CentreFunctions & 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

FormulaDescriptionResult
=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.


Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.