The CODE function in Excel returns the numeric code for a given character. Let’s explore some examples:
Finding the Code for a Character:
- To get the code for the letter “a”, use:
=CODE("a") // Returns 97
- If you have the character “a” in cell A1, the formula below gives the same result:
=CODE(A1) // Also returns 97
- To get the code for the letter “a”, use:
Using CODE to Find Character Codes:
- Suppose you have data with characters like “A”, “a”, “0”, and “-11”. To find their codes, use:
=CODE("Anand") // Returns 65 (code for character 'A') =CODE("An") // Also returns 65
- Suppose you have data with characters like “A”, “a”, “0”, and “-11”. To find their codes, use:
Remember that the CODE function provides the code for the first character only in the given string. Happy Excel coding!