Excel for Microsoft 365Excel for Microsoft 365 for MacExcel for the webExcel 2021Excel 2021 for MacExcel 2019Excel 2019 for MacExcel 2016Excel 2013 More...Less
This article describes the formula syntax and usage of the CODEfunction in Microsoft Excel.
Description
Returns a numeric code for the first character in a text string. The returned code corresponds to the character set used by your computer.
Operating environment
Character set
Macintosh
Macintosh character set
Windows
ANSI
Syntax
CODE(text)
The CODE function syntax has the following arguments:
TextRequired. The text for which you want the code of the first character.
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.
Formula
Description
Result
=CODE("A")
Displays the numeric code for A
65
=CODE("!")
Displays the numeric code for !
33
Need more help?
Want more options?
Discover Community
Explore subscription benefits, browse training courses, learn how to secure your device, and more.
The CODE function in Excel is used to find out the character's code in the string. It finds out the code for the first character only, so if we use this formula as =CODE(“Anand”) and =CODE(“An”), we will get the same result as 65 as the code for character A is 65.
If you're not sure how to use a particular function, you can click the "Help on this function" link at the bottom of the Insert Function dialog box, and that will bring up Excel's Help.
VLOOKUP. The VLOOKUP function is one of the most commonly used and recognizable functions in Excel. It will look for a value in a table and return information from another column relating to that value.
1. Show Formulas option on the Excel ribbon. In your Excel worksheet, go to the Formulas tab > Formula Auditing group and click the Show Formulas button. Microsoft Excel displays formulas in cells instead of their results right away.
Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.
We notice you're using an ad blocker
Without advertising income, we can't keep making this site awesome for you.