The UNICODE function returns the Unicode value of the first character in a string.
This function can be useful for identifying hidden differences between characters, finding non-standard or non-printable characters in text, and creating rules for sorting or checking data.
Syntax
UNICODE(string)
Argument |
Description |
Permitted values |
|---|---|---|
string |
Text for which you need to return a numeric code from the Unicode table |
Text string or reference to a cell containing text |
Examples of use
Use for a single character
=UNICODE("A")
The expression will return 65, since the Unicode code for the letter “A” is 65.
Comparison of character codes
=UNICODE(C3)>UNICODE("Z")
The formula checks whether the first character in cell C3 has a code greater than the letter “Z” (90).
Result: TRUE or FALSE.
Example with a word
=UNICODE("Hello")
The expression will return 72, which corresponds to the code of the first character “H” in Unicode.
Result for an empty string
=UNICODE("")
The expression will return the #VALUE! error.
Notes
The function works correctly only with non-empty strings containing a Unicode character in the first character.