Back to functions
Text2026-11-111 related article

UNICODE Function in Excel

Return the Unicode code point of the first character in a text value.

Syntax

UNICODE(text)
Table of Contents

Arguments

text

Required

The text or cell reference whose first character you want to identify.

What it returns

Returns the decimal Unicode code point of the first character.

What UNICODE does

UNICODE tells you which character is at the start of a text value by returning its Unicode code point as a number. It's useful when an imported space looks normal but won't disappear with TRIM.

To inspect a character farther along a cell, first select it with MID. To go in the other direction, UNICHAR creates a character from its code point.

Practical examples

Identify a visible character

=UNICODE("A")
Formula

The result is 65, the code point for uppercase A. Supplying "Apple" instead would still return 65 because only the first character is inspected.

Find the space that TRIM leaves behind

Create a reproducible example in A3:

="North"&UNICHAR(160)&"Bay"
Formula

This produces North and Bay separated by a nonbreaking space. It follows the five letters in North, so inspect character 6:

=UNICODE(MID(A3,6,1))
Formula

The result is 160. An ordinary space at that position would return 32. =UNICODE(A3) would return 78, identifying N rather than the separator.

Common mistakes and notes

UNICODE identifies a character; it doesn't remove it

Use the code point to choose a repair. For example, TRIM handles ordinary spaces but doesn't remove the nonbreaking space in the second example. Don't strip every unfamiliar character without checking whether it belongs in the data.

A longer argument still gives one code point

UNICODE doesn't return a list of all the characters in a cell. Select the position you need before calling it, as in the MID example.

Malformed input can produce an error

Microsoft's UNICODE documentation specifies #VALUE! for partial surrogates and invalid data types. That is different from a valid but unexpected character. An error in the source formula also needs attention before you can inspect its text.

In Excel for Mac 16.114 (build 16.114.26101123), tested on November 11, 2026, =UNICODE("") returned #VALUE! because there was no character to inspect. A numeric argument didn't necessarily fail: =UNICODE(123) returned 49, the code point for the first character in the text 123. Use the actual text or extracted character you intend to examine rather than relying on that conversion.

Related functions

Related articles

Deep dives, troubleshooting guides, and practical examples that use UNICODE.

Official documentation