說明
Use this function to return the Unicode value of the first character in a text string. This is the opposite of the UNICHAR function.
語法
UNICODE(text)
Inputs
This function accepts the following arguments:
名稱 | 必要 | 說明 | Valid input |
---|---|---|---|
文字|收發簡訊 |
是 | The text for which you want the first character's Unicode value. | A single character that is surrounded by double quotation marks (” “) entered directly into the function, a cell reference, or a formula which results in either of these. |
範例
範例資料
A |
---|
Apple |
Boat |
George |
45 |
Sample formulas
公式 | 說明 | 結果 |
---|---|---|
=UNICODE("A") |
Returns the Unicode value of the first character in the text string "A". | 65 |
=UNICODE(A3) |
Returns the Unicode value of the first character in cell A3. | 71 (the value for "G") |
=UNICODE(A4) |
Returns the Unicode value of the first character in cell A4. | 52 (the value for "4") |
=UNICODE(24) |
Returns the Unicode value of the first character in the text string "24". | 50 (the value for "2") |
=UNICODE(MID(A3,3,2)) |
Returns the Unicode value of the third character in cell A3. | 111 (the value for "o") |
附註
- The UNICODE function returns the Unicode value of the first character in a text string.
- If the text string is empty, UNICODE returns the #VALUE! error.
- The font used in a worksheet may alter the appearance of characters, especially for 'high ASCII' characters (characters numbered 128 to 255, corresponding to Unicode U+0080 to U+00FF). Different fonts may render these characters in various ways, which might affect their visual representation.
- The function can be used to identify characters in a text string that may not display correctly in certain fonts or applications.
提示
- Use UNICODE to find the numeric code of characters, which can be useful for debugging text data issues.
- Combine UNICODE with functions such as MID and LEN to analyze and manipulate text strings more effectively.
- UNICODE returns the code point of the first character only. To get the code points of subsequent characters, use functions such as MID in conjunction with UNICODE. (See example above.)
Related functions
CHAR
CODE
CONCATENATE
CONCATENATEIF
FIND
LEFT
LEN
LOWER
MID
PROPER
REPT
RIGHT
SEARCH
SUBSTITUTE
TEXT
TEXTJOIN
TRIM
UNICHAR
UNICODE
UPPER