Excel - UNICODE Function
UNICODE Function
The Excel UNICODE function will retrieve the numeric value(code point) of the input text's first letter. This function was incorporated into the Excel 2013 version and falls under the Excel TEXT functions category. The UNICODE function is case-sensitive, meaning the resulting values of the upper-case and lower-case first characters in the provided string differ. The inverse of the UNICODE function is the UNICHAR function.
Compatibility
This UNICODE function is compatible with the following versions of MS Excel −
- Excel for Microsoft 365
- Excel for Microsoft 365 for Mac
- Excel for the web
- Excel 2024
- Excel 2024 for Mac
- Excel 2021
- Excel 2021 for Mac
- Excel 2019
- Excel 2016
- Excel 2013
Syntax
The proper syntax of the UNICODE function is as follows −
UNICODE (text)
Arguments
You can use the following arguments with the UNICODE function −
| Argument | Description | Required/ Optional |
|---|---|---|
| Text | A text string or a single character is specified to fetch its Unicode value. | Required |
Point To Remember
- If the first argument, "Text", contains invalid data types, the UNICODE function will retrieve the #VALUE!.
- Ensure that the text string must be enclosed in double-quotes. Otherwise, the UNICODE function will retrieve the #NAME?.
- If the empty text string is provided in the Text argument, then the UNICODE function will return the #VALUE!.
Examples of UNICODE Functions
Practice the following example to learn the use of the UNICODE function in Excel.
Example 1
Solution
Step 1 − First, assume the sample dataset comprises two columns named Text and Result.
Step 2 − After that, select the cell range C3:C9. You may enter the formula =UNICODE(B3).
Furthermore, press the Enter tab to obtain the result.
As you can see in the screenshot, the UNICODE function gives different results for "B" and "b" characters as the code point for the case letters is different in ANSI and UNICODE.
Example 2
If the empty text string is provided in the Text argument, then the UNICODE function will return the #VALUE! error.
Solution
First, you may enter the formula =UNICODE(A2) in the B2.
Once you press the Enter tab, the UNICODE function will return the #VALUE! error.
Example 3
If the first argument, "Text", contains invalid data types and characters, the UNICODE function will retrieve the #VALUE! Error.
Solution
Let's say you write the formula =UNICODE(SUM("as","rg")) in the B2 cell. In this expression, the text value is passed to the SUM function instead of the number, which is invalid.
After that, hit the Enter tab to obtain the resulting value.
Download Practice Sheet
You can download and use the sample data sheet to practice the UNICODE function.