UNICODE
Returns the Unicode code point of the first character in text.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=UNICODE(text)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
text | any | Required | — |
Remarks
- Only the first character is evaluated.
- Non-text inputs are coerced to text before inspection.
- Errors are propagated unchanged.
Error cases
- Empty text returns
#VALUE!.
Examples
Return the numeric character code for the first character in a string.
Formula =UNICODE("ABC")
Expected result 65
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Change the leading character while keeping the rest of the string.
Formula =UNICODE("aBC")
Expected result 97
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Read the numeric code of a single space.
Formula =UNICODE(" ")
Expected result 32
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
An empty string has no first character to encode.
Formula =UNICODE("")
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Code point for letter A
Formula =UNICODE("A")
Expected result 65
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Code point for emoji
Formula =UNICODE("😀")
Expected result 128512
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
If text has multiple characters, which one is used?
UNICODE inspects only the first character and ignores the rest.