Description
Use this function to return the character specified by a number from the character set used by your computer. Supported in Chains.
CHAR is useful for inserting characters based on their numeric code, such as line breaks, special symbols, or control characters. It's also useful for returning a letter character based on a numeric value.
Syntax
CHAR(number)
Inputs
This function accepts the following arguments:
| Name | Required | Description | Valid input |
|---|---|---|---|
number |
Yes | A number that specifies which character to be returned. | A positive integer, a reference to a cell containing a positive integer, or a formula which results in either of these. The integer must be in the range 1-255. |
Example
Sample data
| A | B | |
|---|---|---|
1 |
1 | 65 |
2 |
2 | 66 |
3 |
3 | 67 |
4 |
4 | 68 |
Sample formulas
| Use case | Formula | Explanation and Result |
|---|---|---|
| Convert a numeric character code stored in a cell into its corresponding character. | =CHAR(B1) |
B1 holds the code 65, which CHAR converts into the corresponding letter. Result: A |
| Convert a specific character code typed directly into the formula into its corresponding character. | =CHAR(66) |
Converts the code 66 directly into its corresponding letter. Result: B |
| Combine values from two cells with math, then convert the result into a character. | =CHAR(B3+A3) |
Adds the code in B3 (67) to the row number in A3 (3) to get 70, then converts that combined value into its corresponding letter. Result: F |
| Convert a specific character code typed directly into the formula into its corresponding character. | =CHAR(68) |
Converts the code 68 directly into its corresponding letter. Result: D |
Notes
- CHAR is often used with other functions such as CONCATENATE to insert special characters.
- CHAR can be used to add line breaks in text by using
CHAR(10)(for Windows). - The character set may vary depending on the system, system language, and font used.
Tips
- CHAR is useful for creating dynamic text with special characters in reports and dashboards.
- Combine CHAR with functions such as SUBSTITUTE to manipulate text.