Categories
Excel

Using Code and Char Functions

The CHAR and CODE functions in Excel are useful for working with characters and their numeric codes. The CHAR function returns the character corresponding to a given numeric code, while the CODE function returns the numeric code of a given character.

CODE Function

All characters have a character code, and Excel will tell you what it is if you apply the CODE function to them. The CODE function returns a numeric code for the first character in a text string. The returned code corresponds to the character set used by your computer.

You can use the CODE function in various ways depending on your specific needs. For example, the formula =CODE("H") returns 72, which is the numeric code of H:

  • =CODE("a") returns 97
  • =CODE("A") returns 65
  • =CODE(1) returns 49

CHAR Function

The CHAR function returns a character based on a numeric code. The numeric code can range from 1 to 255, and corresponds to the character set used by your computer. For example, CHAR(65) returns A, CHAR(97) returns a, and CHAR(169) returns ©.

You can use the CHAR function to insert special characters or symbols into your worksheets, such as bullets, or currency symbols.

  • =CHAR(165) returns ¥
  • =CHAR(163) returns £
  • =CHAR(162) returns ¢
  • =CHAR(128) returns

Formula and Functions

  1. Extract Number From Cells That Mix of Text and Numbers
  2. Convert Text to Numbers
  3. Using Code and Char Function
  4. Creating Dependent Combo Box Using Option Buttons
  5. Convert Formulas to Values