Purpose
Return value
Syntax
=UNICHAR(number)
- number - Code point for a Unicode character in decimal.
How to use
The UNICHAR function returns the Unicode character at a given code point, provided as a number in decimal format. To illustrate, the Euro symbol (€) has a code point of 8364 in decimal notation. The following formula will return the Euro character:
=UNICHAR(8364) // returns euro sign "€"
Unicode numbers
Unicode assigns each character a unique numeric value and name. This numeric value is referred to as a "code point". Code points are typically represented by the "U+" notation followed by hexadecimal numbers. For example, the code point for the capital letter A is U+0041, and the code point for the [smiley] emoji is U+1F60A. It is important to understand that the UNICHAR function does not accept Unicode numbers in hexadecimal format, it requires numbers in decimal format. In decimal representation, the code point for "A" is 65, and the code point for the [smiley] emoji is 128522, therefore:
=UNICHAR(65) // returns "A"
=UNICHAR(128522) // returns [smiley]
In Excel, you can use the HEX2DEC function to translate numbers from hexadecimal to decimal if needed.
About Unicode
Excel supports Unicode characters, which are characters that can represent most of the world's writing systems. Unicode is a computing standard that assigns a unique number (code point) to each character, regardless of the font, platform, or program. Because Unicode is a superset of other character sets, it is very large. The first 128 code points in Unicode align exactly with the ASCII characters. In total, Unicode contains over 140,000 characters spanning more than 160 modern and historic scripts, plus thousands of symbols and emoji.
Unicode can be implemented in different encodings, most commonly UTF-8 and UTF-16. It is estimated that over 90% of websites on the internet use UTF-8.
Examples
The Unicode character "★" is code point 9733 in decimal notation, therefore:
=UNICHAR(9733) // returns "★"
To display a different character, change the number to match the symbol you want:
=UNICHAR(10003) // returns "✓"
=UNICHAR(10007) // returns "✗"
=UNICHAR(128578) // returns [smiley]
Here are some more useful Unicode symbols in Excel:
Note: As of this writing in May 2023, emojis in Excel Online (i.e. the web app) appear in color, but emojis in the desktop version of Excel appear in black and white only.
UNICHAR in a formula
The UNICHAR function offers a straightforward way to display a Unicode symbol in a formula. The formula below uses UNICHAR inside the IF function to display a checkmark when a task is complete:
=IF(C5="complete",UNICHAR(10003),"")
A key advantage of this approach is that it is easy to display a different symbol. For example, to display an "X" instead of a check mark, use 10007:
=IF(C5="complete",UNICHAR(10007),"")
This page has an overview of ways to insert a checkmark in a formula.
UNICHAR versus UNICODE
The UNICHAR function translates a given code in decimal number format into a Unicode character. To perform the opposite conversion, see the UNICODE function, which translates a Unicode character into a code in decimal number format.
Notes
- If number is out-of-range, UNICHAR returns #VALUE!
- If number is not a recognized number, UNICHAR returns #VALUE!