CHAR function
Returns the character that belongs to a code number from 1 to 255, such as CHAR(10) for a line break inside a cell.
Available in All versions of Excel, including Microsoft 365, Excel for Mac and Excel for the web
In every Excel versionDifferent in Google Sheets
Syntax
CHAR(number)| Argument | What it means | |
|---|---|---|
number | Required | A whole number from 1 to 255. Decimals are truncated. |
Returns: A single character as text.
How CHAR works
Every character Excel can store has a code number. CHAR goes from the number to the character: =CHAR(65) is A, =CHAR(97) is a, =CHAR(36) is $. On Windows the codes follow the Windows-1252 (ANSI) character set, on older Mac versions the Mac Roman set, so codes above 127 can give different symbols on different machines.
The most common real use is CHAR(10), the line feed, which starts a new line inside a cell. Join pieces of an address or a label with &CHAR(10)& and switch on Wrap Text for the cell, otherwise the break is invisible. Other handy codes are CHAR(34) for a double quote, CHAR(9) for a tab and CHAR(160) for a non-breaking space.
CHAR only covers codes 1-255. For any other symbol (arrows, stars, emoji, Greek or Cyrillic letters) use UNICHAR, which accepts full Unicode code points. The reverse of CHAR is CODE.
Examples
1Turn a column number into a column letter
| A | B | |
|---|---|---|
| 1 | Column no. | Letter |
| 2 | 3 | C |
| 3 | 12 |
Result: C
The capital letters start at code 65 (A), so 64 + 3 = 67, which is C. This trick works for columns 1-26.
2Address on two lines in one cell
| A | B | C | |
|---|---|---|---|
| 1 | Customer | City | |
| 2 | Ana Silva | Lisbon | Ana Silva Lisbon |
Result: Ana Silva
Lisbon
CHAR(10) inserts a line feed between the name and the city. With Wrap Text switched on for C2 the cell shows Ana Silva on the first line and Lisbon on the second.
3Put quotation marks around a value
| A | B | |
|---|---|---|
| 1 | Product | |
| 2 | Desk Lamp | "Desk Lamp" |
Result: "Desk Lamp"
CHAR(34) is the double-quote character, which is easier to read than writing """" inside a formula.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | The number is below 1 or above 255, or is text. | Use a value from 1 to 255; for higher Unicode code points use UNICHAR. |
Tips
- A line break made with CHAR(10) needs Wrap Text on the cell to be visible; on a Mac in very old versions the line break was CHAR(13).
- To remove line breaks again use
=SUBSTITUTE(A2,CHAR(10)," ")or CLEAN. CHAR(128)is the euro sign on Windows but not on every platform. UseUNICHAR(8364)when the workbook travels between systems.
Google Sheets
Google Sheets uses Unicode for every code, so CHAR for codes 128–255 can return different characters than Excel for Windows, which uses the ANSI code page.
CHAR in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | ZNAK |
| Danish | TEGN |
| Dutch | TEKEN |
| Finnish | MERKKI |
| French | CAR |
| German | ZEICHEN |
| Hungarian | KARAKTER |
| Italian | CODICE.CARATT |
| Norwegian (Bokmål) | TEGNKODE |
| Polish | ZNAK |
| Portuguese (Brazil) | CARACT |
| Portuguese (Portugal) | CARÁT |
| Russian | СИМВОЛ |
| Spanish | CARACTER |
| Swedish | TECKENKOD |
| Turkish | DAMGA |