The CHAR function
Returns the character for a code number. CHAR(65) is A, and CHAR(10) is a line break, the usual way to put line breaks into a formula.
Syntax
CHAR(number)- number
- A code from 1 to 255.
Examples
B1=CHAR(65)
| A | B | |
|---|---|---|
| 1 | A |
D1=CHAR(64+B1)
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Position in the alphabet | 3 | C |
D1=A2&CHAR(10)&B2
| A | B | C | D | |
|---|---|---|---|---|
| 1 | First | Last | Ann Berg | |
| 2 | Ann | Berg |
Questions
Why doesn't CHAR(10) start a new line?
The cell needs Wrap Text turned on (Home > Wrap Text). Without it, Excel shows the line break as nothing at all.
What is the opposite of CHAR?
CODE returns the number for a character, so =CODE("A") is 65. Together they are handy for turning column numbers into letters and back.