What is the CHAR function?
=CHAR(number)CHAR turns a character code from 1 to 255 into a character. Its most common use is CHAR(10), a line break inside a cell.
According to Microsoft, the result follows your computer's character set (ANSI on Windows, the Mac character set on Mac). Codes 32–126, with letters, digits and symbols, are the same everywhere, but 128 and above can vary, so they are left out of the example above.
Arguments
- number
- A character code from 1 to 255. Outside that range gives #VALUE!.
CHAR examples
Example 1. Example from Microsoft
=CHAR(65)A. CHAR(33) is !.
Example 2. Line break in a cell
=A2 & CHAR(10) & B2Puts a line break between two values. Turn on Wrap Text for the cell to see two lines.
Example 3. Make A to Z
=CHAR(64+ROW())Enter it in row 1 and fill down to get A, B, C...
Common mistakes
The line break does not show
Even with CHAR(10), the text shows on one line if Wrap Text is off.
Making non-ASCII characters
CHAR only goes up to 255. Use UNICHAR to make a character from its Unicode number.
FAQ
- What is the opposite function?
- CODE. CODE("A") is 65.
- Remove line breaks?
- Replace them with spaces, like =SUBSTITUTE(A2, CHAR(10), " "), or use CLEAN.