Contact

UNICODE in Excel: Inspect First Characters and Hidden Spaces

Text Intermediate Microsoft Excel

Read Unicode code points in Excel, diagnose leading spaces and distinguish visually similar text without treating the first character as a full-string test.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: UNICODE(text) returns the code point of the first character. It is useful for diagnosing a leading character or one deliberately extracted position, but it does not encode or validate the entire string.

Availability and version history

  • Introduced: the Microsoft function catalogue marks this identity as an Excel 2013 addition. An exact first build or preview date is not established.
  • Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
  • Checked: October 14, 2026; official UNICODE reference. Documentation and independent models; no native Excel execution or wider platform certification.

Syntax and interpretation

=UNICODE(text)

Microsoft documents #VALUE! for partial surrogates or invalid data types. The short reference does not pin every empty-input, numeric-coercion or malformed-sequence boundary, so the examples supply actual nonempty text.

A code point identifies a character, not its font, width or byte length in an exported file. Different encodings can represent the same character using different bytes. Conversely, two visually similar strings can have different sequences of code points.

Example 1: first-character controls

Enter these strings in A2:A7. In B2 enter =UNICODE(A2) and fill through B7:

A: text B: expected integer
Alpha 65
alpha 97
Beta 66
αlpha 945
€25 8364
7 units 55

The first character of 7 units is the digit character 7, whose code point is 55; it is not the number 7. Alpha and Apple both produce 65, so matching UNICODE results does not establish that two complete strings match.

These controls are independently checked against Unicode identities. Font substitution may change how the Greek or currency glyph looks, without changing the requested code-point value.

Example 2: inspect a space at a known position

Build A10 as =" "&"North" and A11 as =UNICHAR(160)&"North". The first starts with an ordinary space and the second with a nonbreaking space.

=UNICODE(A10)
=UNICODE(A11)

The expected outputs are 32 and 160. They give a concrete explanation for why two apparently similar imported labels may behave differently in cleanup routines.

For an internal separator, place ="East"&UNICHAR(160)&"Zone" in D2. =UNICODE(MID(D2,5,1)) returns 160. In D3 use:

=SUBSTITUTE(D2,UNICHAR(160)," ")

Now =UNICODE(MID(D3,5,1)) returns 32. This checks exactly the separator that was replaced. It does not certify that D3 contains no other invisible characters.

Advanced example: inspect a complete short identifier

Put the text A 7 in G2. Enter positions 1, 2 and 3 in H2:H4. In I2 use and fill down:

=UNICODE(MID($G$2,H2,1))

The results are 65, 32 and 55. Each position corresponds to one simple character in this controlled ASCII identifier. Reconstructing the sequence with =UNICHAR(I2)&UNICHAR(I3)&UNICHAR(I4) produces A 7.

If the second position instead contains the nonbreaking-space construction, the middle result becomes 160. This small diagnostic table is more informative than repeatedly applying cleanup functions without identifying what changed. Keep the raw value beside the cleaned value and record the replacement rule.

Do not extend this exact positional method blindly to every emoji or combined character. Workbook compatibility settings and character-sequence handling can affect extraction. Those native boundaries have not been executed for this guide.

Visually similar accented text

Create J2 with =UNICHAR(233) and J3 with =UNICHAR(101)&UNICHAR(769). The first is a precomposed é; the second is an e followed by a combining acute accent. They may display similarly, but =UNICODE(J2) returns 233 and =UNICODE(J3) returns 101.

This does not mean one spelling is inherently wrong. It shows that the first character differs and that visual inspection is insufficient to prove identical storage. UNICODE itself does not apply a normalization standard or compare whole strings.

Practical checks

  • Inspect the position relevant to the problem, rather than assuming the offending character is first.
  • Preserve the text source; a code point alone cannot reconstruct the rest of a string.
  • Avoid treating code-point order as a language-aware alphabetical sorting rule.
  • Use UNICHAR for the inverse construction, MID for the simple-position examples and SUBSTITUTE for a documented replacement policy. An unexplained blank or malformed input should be investigated before replacing its error with zero.

References and verification

Expected outputs are independently calculated examples or documented rules, not captured native Excel results. Formulas use English function names and comma argument separators. Locale, rendering and boundary restrictions are stated where relevant.