CODE function

CODE function is a useful tool in Excel that allows you to find the numeric code of the first character in a given text string. This code represents the character’s position in the ASCII (American Standard Code for Information Interchange) character set.

Syntax

CODE(text)

Arguments

textThe text for which you want to find the numeric code of the first character.

How to Use

The CODE function is straightforward to use. You only need to provide the ‘text’ argument, and it will return the numeric code for the first character in that text. Let’s see some examples:

This formula will return the code 65 because ‘A’ is the first character in the text, and its ASCII code is 65.

Here, the function will return 97 because it calculates the code for the first character ‘a’ in the word ‘apple’.

In this case, the result will be 69, as ‘E’ is the first character in the text “Excel” with an ASCII code of 69.

Remember, the CODE function is limited to finding the code for the first character in a text string. If you want to find codes for multiple characters, you can use a combination of functions like LEFT, MID, or a custom VBA (Visual Basic for Applications) macro.

Additionally, if you ever come across an unfamiliar term, you can search for its definition on a trusted website like Wikipedia.

Tomasz Decker is an Excel specialist, skilled in data analysis and financial modeling.