The CHAR function allows you to print characters and letters using their ASCII number. Read on to learn how this can be useful, and how you can use the CHAR function.
The CHAR Function
CHAR is a core Excel function that takes in an ASCII code and returns the symbol or character for that number. ASCII stands for American Standard Code for Information Interchange. ASCII codes are used in computers and telecommunication systems, where they turn data into standard digital formats that can be stored in computer storage.
ASCII includes the English letters, numbers, most symbols, and some non-printing characters such as (nl). It is these non-printing characters that make CHAR a useful function. For instance, you can add a line break to a cell or function using the CHAR function.
The CHAR function can also be an alternative escape from wildcards in Excel. For example, if you want to use the asterisk (*) in a function but don’t intend it to be a wildcard, you can use the CHAR function to print it.
Aside from these usages, you can also use the CHAR function for ordinary letters and numbers as well. For instance, the number 65 is an ASCII code for the letter A.
The CHAR function is straight-forward and has only one variable. You need only give it the ASCII number for a character, and it will return the character itself.
You can find a full list of ASCII characters in the ASCII table that the University of Villanova has put together. You can also create a program that finds the ASCII value of a character.
How to Use the CHAR Function in Excel
To get an idea of the CHAR function, let’s use it to type MUO in a cell. You can use the ampersand handle (&) to combine multiple CHAR functions together in a single cell.
The ASCII numbers for M, U, and O are 77, 85, and 79, respectively. Now let’s write these out using the CHAR function.
Select the cell where you want to display the output. We’re going to use cell A1. Type in the formula below in the formula bar: =CHAR(77) & CHAR(85) & CHAR(79) This formula calls on three CHAR functions to type the three specified characters. Press Enter. The cell will now show MUO.
Frankly, in this case, typing MUO would have been much easier. But now that you know how to use the CHAR function, let’s see it at work with a more practical example.
In this example, we’re going to use the CHAR function to create a line break in an Excel cell. The goal is to have a cell show the text Microsoft Excel with a line break between Microsoft and Excel. The ASCII number for a line break is 10.
Select the cell where you want to show the text. We’re going to use cell A1 for this example. Go to the Home menu from the ribbon and click on Wrap Text. Go to the formula bar and enter the formula below: =“Microsoft” & CHAR(10) & “Excel” This will call the CHAR function between the two words and apply a line break. Press Enter.
Turn Numbers Into Letters With CHAR
CHAR is a function that lets you turn ASCII numbers into their characters. Aside from typical letters and numbers, you can use the CHAR function to integrate non-printable characters such as line breaks into your formulas. This has the potential to enable you to create sophisticated compound formulas in Excel.