CODE(text)
=CODE("a")
The CODE function takes an argument, which can be either a single character or a number, and returns the corresponding ASCII value. For example, this formula returns 97
=CODE("A")
The CODE function is case-sensitive. This example, returns 65 because "A".
The CODE function returns a numeric code for the first character of a text string, based on the character set used by the user's computer. The code may change when the user changes their settings.