How to use the Excel CODE function

The Excel CODE function returns a numeric code for a given character.  For example, CODE(“a”) returns the code 97. The CODE function can be used to figure out numeric codes supplied to the CHAR function.

Syntax: =CODE(text)

The CODE function syntax has the following arguments:

  • text: The specified character to retrieve the ASCII value for. If there is more than one character, the function will return the ASCII value for the first character and ignore all of the characters after the first.

Example: Let’s look at some Excel CODE function examples and explore how to use the CODE function as a worksheet function in Microsoft Excel:

Syntax:  =CODE(A2)


Result: 66

Result: 67

Result: 97

Result: 98

Result: 99

Add a Comment

Your email address will not be published. Required fields are marked *