Skip to content

How to Use Excel CODE Function?

CODE FunctionPin
CODE Function

Excel CODE Function: We all know that Excel has numerous features to perform various mathematical operations. On that note, the CODE function is a built-in function in Excel that is categorized as a String/Text Function. returns the numeric code of the given character.

This article describes the explanation, syntax, and usage of the CODE function in Excel. Get the official version of MS Excel from the following link:

Excel CODE FunctionPin
Excel CODE Function

Explanation of CODE Function

  • It is one of the built-in functions in Excel.
  • The CODE Function in Excel returns a numeric code for the first character in a text string.
  • This Function takes out the text or a character that displays the output in a numeric code form.


  • Here, you will see the syntax of the CODE function.
  • To apply this function on your spreadsheet, you have to select a cell and enter the formula in the following format.
  • Once you enter the formula, just click on the Enter button to get the result.


Argument Description:

  • Text – The text for which you want a numeric code.

Practical Examples

Let’s look at the examples of the CODE function and explore how it works in the Excel worksheet.

  • Initially, you have to open your Excel workbook on your PC and launch a worksheet that has data.
  • For example, we have entered a letter in Cell B3, and we are going to get the numeric code value for this input.
  • Now, we need to enter the above-mentioned formula to get the result.
Enter the formulaPin
Enter the formula
  • After entering the formula, you need to click the Enter button to get the output, as shown below.
  • In the following image, you will see a range of input text strings, and we will get the code value for those values using the CODE function.
Range of inputPin
Range of input
  • Once you get the first value, you can simply drag down the cell to fill the remaining values, as shown in the below image.
  • If you give the text string, then the CODE function will return the code value for the first letter in the string.


In the above article, we have learned how to use CODE Function in Excel Office 365 with a few practical examples. Kindly, drop your feedback in the below comment section. To learn more about Excel functions, then visit our webpage

Video Tutorial

The following video will show you how to apply the CODE function in the Excel worksheet.

Related Articles:


Leave a Reply

Your email address will not be published. Required fields are marked *

Share to...