1. Home
  2. Functions
  3. Text
  4. CODE

CODE function

Returns the code number of the first character of a text.

Syntax

=CODE(text)

Arguments

ArgumentRequiredDescription
textRequiredThe text whose first character you want the code of

How to use CODE

CODE takes 1 required argument. Type =CODE( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=CODE("A")Result 65
=CODE("!")Result 33
=CODE("")Result #VALUE!

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.