CODE function comes under the TEXT category in Excel.
CODE FUNCTION RETURNS THE ANSI/ASCII CODE OF THE GIVEN CHARACTER OR THE FIRST LETTER OF THE GIVEN STRING
ANSI, while the development of computing system defined the characters such as a to z, A TO Z, !,@ and so many other symbols with the ANSI CODE ranging from 0 to 255.
This function is specifically used if we want to compare any character on the basis of its ANSI CODE.
PURPOSE OF CODE FUNCTION IN EXCEL
CODE FUNCTION returns the ANSI/ASCII CODE of the given character or the first character of the given string.
PREREQUISITES TO LEARN CODE FUNCTION
THERE ARE A FEW PREREQUISITES WHICH WILL ENABLE YOU TO UNDERSTAND THIS FUNCTION IN A BETTER WAY.
- Basic understanding of how to use a formula or function.
- Basic understanding of rows and columns in Excel.
- Some information about the financial terms is an advantage for the use of such formulas.
- Of course, Excel software.
SYNTAX: CODE FUNCTION
The Syntax for the CODE function is
CHARACTER The character of which we want to find the ASCII CODE.
STRING We can pass the argument as the string too but the code would be returned only of the first letter of the string.
EXAMPLE:CODE FUNCTION IN EXCEL
Let us find out the codes of different character to learn the working of CODE FUNCTION in Excel.
The codes are following.
STEPS TO USE CODE FUNCTION
- Put the characters in one cell each.
- Put the function =Code(character/string or the cell containing the character/string).
- For our example number 1, the function used is =CODE(G7).
- Drag down the formula through the column.
- The output will be returned as a number which will be the ASCII CODE of that particular character or first letter of the string.
- The results are shown in the picture above and in the table given below.
STEPS TO USE CODE FUNCTION USING DIRECT VALUES AND STRINGS
WHAT ARE ANSI/ASCII CHARACTERS
A SPECIAL NUMBER WAS ASSIGNED FOR EVERY CHARACTER WHICH WE CALL AS CODE
DIFFERENCE BETWEEN CHAR AND CODE FUNCTIONS
Hi, you can have a look at the video showing the usage of CODE FUNCTION.
OTHER WAYS TO REACH THIS ARTICLE
WHAT IS EXCEL, HOW EXCEL WORKS, WRITE FORMULA IN EXCEL, EXAMPLE OF USING FORMULA IN EXCEL, ANIMATED EXAMLPE OF USING FORMULA IN EXCEL
YOU MAY LIKE
- HOW TO TROUBLESHOOT A FORMULA IN EXCEL?
- USE OF FONTS, FONT SIZE, INDENTATION, TEXT TO THE RIGHT, TEXT TO THE LEFT, TEXT IN THE MIDDLE ETC.
- how to insert table in excel?
- FOR MORE ARTICLES, CLICK EXCEL OR TYPE IN SEARCH BELOW.