CODE
Converting Between Characters & Numeric Codes

Basic Description

The Excel Code function converts the first character of a supplied text string into the associated numeric character set code used by your computer.

- note that this code may vary across different computer systems.

The syntax of the Code function is :

CODE( text )

Where the text argument is a text string, which is supplied to the function either directly or as a reference to a cell containing a string.

Code Function Examples

The following spreadsheet shows examples of the Excel Code function used to return the numeric code for a number of different text strings.

The format of the function is shown in the spreadsheet on the left and the results are shown in the spreadsheet on the right - Note that these results are from the Ansi character set (used on the Windows operating system).

 Formulas:
 AB
1 Alpha =CODE( A1 )
2 alpha =CODE( A2 )
3   =CODE( "?" )
4   =CODE( "3" )
 Results:
 AB 
1 Alpha 65   - returns the code for the character "A"
2 alpha 97   - returns the code for the character "a"
3   63
4   51
Excelq.com doing business as a Service of Venttraffic Media Inc. Excel and other words on this site may be trademarks or registered trademarks of Microsoft Corporation. Microsoft Corporation is not connected in any way with this website, and makes no endorsement of the site or its related contents. All rights reserved. Website powered by Venttraffic Media Inc.