How to Use CHAR in Excel
In this article
Yes, you can convert numbers into their corresponding text characters using the Excel CHAR function. This is useful for generating special symbols, creating custom separators, or decoding data hidden as characters. You do not need any special software; a standard installation of Microsoft Excel or Google Sheets is sufficient. The function works by taking a number (the ASCII code) and returning the specific character assigned to that code.
What You'll Need
- A computer with Microsoft Excel installed (Windows, macOS, or Web) or Google Sheets.
- A spreadsheet file with data or a blank workbook to practice.
- A basic understanding of ASCII codes (optional, but helpful).
Step-by-Step
- Open your workbook. Launch Microsoft Excel or Google Sheets and open the spreadsheet where you want to use the CHAR function. You can work on a blank sheet to test the functionality first.
- Locate an empty cell. Click on any blank cell where you want the text character to appear. This cell will display the result of the function.
- Start typing the function. Begin typing =CHAR( into the selected cell. Excel will recognize this as a formula and display the syntax hint.
- Enter the ASCII number. Type the number you want to convert. This number corresponds to a specific character in the ASCII standard. For example, to get a quotation mark, you would type 34. To get a carriage return, you would type 13. If you are using Google Sheets, you can also click on a cell containing a number and then reference that cell inside the parentheses.
- Close the parenthesis. Type the closing parenthesis ) to finish the formula syntax.
- Press Enter. Press the Enter key on your keyboard. Excel will calculate the function and display the text character in the cell. For instance, typing =CHAR(65) will display the capital letter "A".
- Drag the fill handle (optional). If you are converting a list of numbers, hover your mouse over the bottom-right corner of the cell containing your formula until the cursor changes to a small cross. Click and drag down to apply the formula to the rest of your numbers.
Common Mistakes
One of the most common errors is using a number outside the valid ASCII range. The CHAR function only works with numbers between 1 and 255. If you enter a number like 300, Excel will return the #VALUE! error. This is because the standard ASCII table ends at 127 for basic characters, and extended ASCII tables only go up to 255. Another frequent mistake is forgetting to type the equals sign at the beginning of the formula, which causes Excel to treat the entry as plain text rather than a calculation.
Tips
To use CHAR effectively, it helps to know a few key codes. For instance, CHAR(10) represents a line break, which is useful when you need to force text to wrap onto a new line within a single cell. CHAR(9) is a tab character, which can be used to create simple data separation. When combining CHAR with other functions like CONCATENATE or the ampersand (&) operator, you can build more complex strings, such as joining a name with a line break and a title.
Troubleshooting
If the formula returns the #VALUE! error, double-check that the number inside the parentheses is a valid integer. Ensure there are no spaces before the equals sign and that all parentheses are closed properly. If you are using Google Sheets and the result is not displaying as a character you expect, verify that the number corresponds to the correct character set. While Excel and Google Sheets generally use the same standard ASCII values, regional settings can sometimes affect how extended characters are interpreted.
Frequently Asked Questions
What does the CHAR function do in Excel?
The CHAR function converts an ASCII number into its corresponding character. For example, 65 becomes "A" and 10 becomes a line break.
Why does CHAR return a #VALUE! error?
This error occurs when the number provided is outside the valid range of 1 to 255 or if the input is not treated as a number.
Can I use CHAR to create a new line in a cell?
Yes, CHAR(10) is the code for a line break. You can use it with the line break character or the CONCATENATE function to stack text vertically in a single cell.
What is the difference between CHAR and UNICHAR?
CHAR is limited to the standard ASCII character set (1-255). UNICHAR (available in newer versions of Excel and Google Sheets) can convert any Unicode number into a character, supporting a much wider range of symbols and emojis.
How do I insert a tab character using CHAR?
Type =CHAR(9) into a cell to insert a tab character. This is useful for aligning text or separating data points.
Does CHAR work in Google Sheets?
Absolutely. The syntax =CHAR(number) works identically in Google Sheets as it does in Microsoft Excel.