CODE

Formulas / CODE
Identify a numeric code for a character.
=CODE(text)
  • text - the text to get the code of the first character of

Examples

  • =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".


Summary

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.

  • The CODE function returns a numeric code for a given character in an ASCII world.
  • The CODE function can only map characters to numbers.

Frequently Asked Questions

What is the CODE function?
The CODE function is a function that returns a numeric code for the first character in a text string. The code returned is from the character set used by the computer.
What does the CODE function take as an argument?
The CODE function takes a text argument as an input.
Is the text argument required?
Yes, the text argument is required.
What is the purpose of the text argument?
The text argument is the text used to get the code of the first character of.
Sourcetable Logo

Work smarter

Al is here to help. Leverage the latest models to
analyze spreadsheets, enrich data, and create reports.

Drop CSV