Excel Function: UNICHAR
Purpose
The UNICHAR function translates a number into the character it corresponds to in the unicode character set. In addition to allowing one to include useful but difficult-to-access unicode characters in the outputs generated by formulae, UNICHAR provides a means through which one can work with non-printing characters, such as line breaks and carriage returns.
Invocations of the UNICHAR function take the form:
UNICHAR(number)
Example
Consider a cell containing the formula:
=CONCAT("Hello", UNICHAR(10), "World")
The formula concatenates “Hello”, UNICHAR(10) and “World” together and returns the following text value:
Hello
World
UNICHAR(10) is translated into the new-line non-printing character and is responsible for “Hello” and “World” appearing on different lines.
Arguments
Argument | Argument type | Description |
---|---|---|
number | Mandatory | A number whose corresponding unicode character will be looked up & returned. |
Related Functions
Function | Example | Purpose |
---|---|---|
CHAR | CHAR(number) | Translates a number into the character to which it corresponds in the character set of your computer. CHAR is limited to translating numbers between 1 & 255 to characters. |
Error Conditions
Error value | Condition type | Condition |
---|---|---|
#VALUE! | Bad argument | The number supplied as an argument does not correspond to a unicode character. |
#VALUE! | Bad argument | Either the value supplied to the number argument is not a number or it can’t be treated as one. |
#VALUE! | Bad argument | The value zero (0) was supplied to the number argument. |
Examples
Example | Formula | Result | Description |
---|---|---|---|
1 | =UNICHAR(100) | d | The unicode character corresponding to the number passed to it is returned. |
2 | =UNICHAR(DATE(2023,5,7)) | 꿽 | The date May 7, 2023 is stored as 45053. The unicode character “꿽” was returned. |
3 | =UNICHAR("1E+3") | Ϩ | Text that can be interpreted as a number will not cause an error. |
Examples: Errors
Example | Formula | Result | Description |
---|---|---|---|
1 | =UNICHAR(0) | #VALUE! | Supplying zero (0) to the UNICHAR function causes an error. |
2 | =UNICHAR("a") | #VALUE! | The value supplied to the number argument was not a number. |
3 | =UNICHAR(5000000) | #VALUE! | The value supplied to the number argument did not correspond to a unicode character. |