CODE(text)

Returns the ANSI/ASCII number for the first character in a text string.

textThe text string you want the first character code for.

Remarks

* The "text" can be a text string, a cell reference or a named range.
* If "text" contains more than one character, then the first character is used.
* If "text" is an empty strings, then #VALUE! is returned.
* If you are using Windows then the character set is ANSI (which is identical to ASCII).
* If you are using Macintosh then the character set is different to Windows.
* For a full list of all the ASCII String Codes, please refer to the ASCII String Table page.
* You can use the CHAR function to return the character with the corrresponding ANSI/ASCII character.
* You can use the UNICHAR function to return the character with the corresponding UNICODE number.
* You can use the UNICODE function to return the UNICODE number for the first character in a text string.
* For more information about the different character sets refer to the Character Codes page.
* For the Microsoft documentation refer to support.office.com

 A
1=CODE("A") = 65
2=CODE("B") = 66
3=CODE("C") = 67
4=CODE("a") = 97
5=CODE("b") = 98
6=CODE("Alphabet") = 65
7=CODE(-1) = 45
8=CODE(CHAR(23)) = 23
9=CODE("some text") = 115
10=CODE("") = #VALUE!

1 - What is the number corresponding to the character "A".
2 - What is the number corresponding to the character "F".
3 - What is the number corresponding to the character "a".
4 - What is the number corresponding to the character "b".
5 - What is the number corresponding to the first character is the string "Alphabet".
6 - What is the number corresponding to the first character is the string "-1".

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top