Excel: CHAR & CODE Functions

Share this video:

About the video

CHAR

CHAR function in Excel returns a character when given a valid character code. CHAR can be used to specify characters that are hard to enter in a formula. For example, CHAR(10) returns a line break, and can be used to add a line break to text in a formula. Text wrap must be enabled to see the line break take effect. CHAR function takes just one argument, number, which must be an integer between 0-255. The result from CHAR is a text value. It was designed to operate in an ASCII/ANSI world, and only understands numbers 0-255. CHAR can be useful when you want to specify characters in formulas or functions that are awkward or impossible to type directly.

CODE

CODE function returns a numeric code for a given character. For example, CODE("A") returns the code 65. Generally speaking, the number returned by CODE is the code for a character in ASCII decimal notation. The CODE function was designed to operate in an ASCII/ANSI world, and only understands how to map characters that correspond to numbers 0-255. The CODE function takes a single argument, text, which is normally a text value. If text contains more than one character, the CODE function returns a numeric code for the first character.

Share this video: