UNICODE function

UNICODE returns the decimal Unicode code point of the first character in a text string, letting you work with character codes in spreadsheets.

=UNICODE(text)

Generate a UNICODE formula

Describe what you need. The generator will reach for UNICODE where UNICODE is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How UNICODE reads its arguments
textrequiredUNICODE
ArgumentRequiredDescription
textRequiredA required text argument; if omitted, blank, or not coercible to text, UNICODE returns a #VALUE! error.

Returns

A single numeric value representing the Unicode code point of the first character.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Find the code point for the first letter of an ingredient

IngredientSupplierUnitQtyExpiry Date
TomatoesFreshFarmkg252024-10-01
Olive OilGourmetSupply™L102025-05-15
ParmesanDairyBestkg52023-12-20
=UNICODE(A2)

Result: 84

Cell A2 contains the word "Tomatoes". The first character is "T", whose Unicode decimal code point is 84. UNICODE reads only that first character, ignores the rest of the word, and returns 84 as a plain number.

2. Get the code point of a trademark symbol from a supplier name

IngredientSupplierUnitQtyExpiry Date
TomatoesFreshFarmkg252024-10-01
Olive OilGourmetSupply™L102025-05-15
ParmesanDairyBestkg52023-12-20
=UNICODE(RIGHT(B3,1))

Result: 8482

B3 holds "GourmetSupply™". The RIGHT function extracts the last character, which is the trademark symbol "™". UNICODE then translates that single symbol into its decimal code point, 8482, and returns it.

3. Determine the code point of the month abbreviation's first letter in an expiry date

IngredientSupplierUnitQtyExpiry Date
TomatoesFreshFarmkg252024-10-01
Olive OilGourmetSupply™L102025-05-15
ParmesanDairyBestkg52023-12-20
=UNICODE(LEFT(TEXT(E2,"mmm"),1))

Result: 79

E2 stores the date 2024-10-01. TEXT formats it as "Oct", the three-letter month abbreviation. LEFT then takes the first character "O". UNICODE finally returns the code point for "O", which is 79.

Common errors

Which UNICODE error are you seeing?
UNICODE returned an error#VALUE!
Wrap the argument in TEXT() or ensure the cell contains at least one visible character before calling UNICODE.
#REF!
Correct the cell reference so it points to an existing cell containing the desired text.
#N/A
Replace the #N/A with a valid text string or use IFNA() to provide a fallback before calling UNICODE.
ErrorWhy it happensHow to fix it
#VALUE!The text argument is an empty string or a number that cannot be coerced to text.Wrap the argument in TEXT() or ensure the cell contains at least one visible character before calling UNICODE.
#REF!The formula references a cell that has been deleted or is otherwise invalid.Correct the cell reference so it points to an existing cell containing the desired text.
#N/AThe argument itself contains the #N/A error value, which propagates through UNICODE.Replace the #N/A with a valid text string or use IFNA() to provide a fallback before calling UNICODE.

Tips and when to use something else

  • UNICODE works on the first character only; combine it with LEFT, RIGHT, or MID to target a specific position.
  • If you need the numeric code for every character in a string, use BYROW or BYCOL with a LAMBDA that calls UNICODE on each slice.
  • When you want the character itself from a code point, use the CHAR function instead of UNICODE.
  • Remember that UNICODE respects the workbook's locale; for non-ASCII symbols verify the code point with an online Unicode table.

Frequently asked questions

Why does UNICODE return #VALUE! when I reference a numeric cell?
UNICODE expects a text string. When you pass a pure number, Excel cannot determine a character to evaluate, so it throws #VALUE!. Convert the number to text first, for example with TEXT(A1,"0") or by concatenating an empty string.
Can UNICODE handle emojis or other multi-byte characters?
Yes. UNICODE returns the code point for the first Unicode scalar value, even for emojis. However, some emojis are represented by surrogate pairs; UNICODE will only give the code of the first surrogate, which may not be the full emoji.
What is the difference between UNICODE and CODE in older versions of Excel?
CODE was limited to the ANSI character set and returned values 1-255. UNICODE supersedes it by supporting the full Unicode range, returning values up to 1,114,111. Use UNICODE for modern multilingual datasets.
How can I get the Unicode code point of the last character in a cell?
Combine RIGHT to extract the last character with UNICODE. For example, =UNICODE(RIGHT(A2,1)) will return the code point of the final character in cell A2, regardless of string length.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator