CODE

Using the Excel CODE Function

Summary

The Excel CODE function returns a numeric code for the first value of a text string where the returned code corresponds to the character set used by your computer.

The character set used on a Windows machine is ANSI. For a Macintosh OS, it is the Macintosh character set.


Syntax

=CODE (text)

Syntax Breakdown

Text
Required. Text for which you want to find a character code.


Usage Notes

CODE returns a numeric code for the first character in a text string. The function is useful if you need to figure out a numeric code used in the CHAR function.

The character set used by your computer will influence the code. To learn more about character sets, see the following:

Windows: https://en.wikipedia.org/wiki/Windows-1252

Macintosh: https://en.wikipedia.org/wiki/Mac_OS_Roman