Google Sheets CODE  Function

This post will guide you how to use Google Sheets CODE  function with syntax and examples.

Description


The Google Sheets CODE function returns the numeric Unicode map value for the first character of a text string. And you can get the Unicode table online at the Unicode website.

The CODE function can be used to get a numeric code for a given character or a text string. For example, if you wish to get a Unicode map value of the character “a”, and you can use the CODE(‘a’) function to get the numeric code 97 in a formula in google sheets.

The CODE function is a build-in function in Google Sheets and it is categorized as a Text Function.

Syntax


The syntax of the CODE function is as below:

=CODE(text)

Where the CODE function argument is:

Text -This is a required argument. The text strings that you want to get the numeric Unicode map value of the first character

Note:

  • You need to know that the CODE function will only convert the first character in a text string and other characters will be ignored.
  • The CODE function only takes one argument, which is normally a text string or character. If the text value contains more than one character, and the CODE function only returns a Unicode map value for the first character.
  • The CODE function only handle numeric input for the numbers 0-9.

Example


#1 To get the numeric Unicode map value of the character “c”, just using the following CODE function:

=CODE(“c”)

google sheets code function

#2 To get the numeric Unicode map value of the character “c” in cell A1, just using the following CODE function:

=CODE(A1)

google sheets code function

#3 To get the numeric Unicode map value of string “code”, just using the following CODE function:

=CODE(“code”)

google sheets code function

#4 To get the numeric Unicode map value of numeric input for number 1, using the following CODE function:

=CODE(1)

google sheets code function

So the numeric value returned by the CODE function is the code for a character in Unicode table.

If you want to get a character for given numeric code in Unicode table, and you can use the CHAR function, For example, if you want to get a Unicode character for a numeric value 65, and you can use the following CHAR function:

=CHAR(65)

google sheets code function

Related Functions


  • Google Sheets CHAR function
    The Google Sheets CHAR function returns the character specified by a number (ASCII Value) according to the current Unicode table. The syntax of the CHAR function is as below:=CHAR(number)….
Related Posts

Google Sheets PROPER Function
google sheets proper function1

This post will guide you how to use Google Sheets PROPER function with syntax and examples. Description The Google Sheets PROPER function capitalizes the first character in each word of a text string and set other characters to lowercase . ...

Google Sheets MIDB Function
google sheets midb function1

This post will guide you how to use Google Sheets MIDB function with syntax and examples. Description The Google Sheets MIDB function returns a substring (a specified number of bytes) starting from the middle of a text string and up ...

Google Sheets MID Function
google sheets mid function

This post will guide you how to use Google Sheets MID function with syntax and examples. Description The Google Sheets MID function returns a substring (a specified number of the characters) starting from the middle of a text string. The ...

Google Sheets LOWER Function
google sheets lower function1

This post will guide you how to use Google Sheets LOWER function with syntax and examples. Description The Google Sheets LOWER function converts all characters in a text string to lowercase. The LOWER function can be used to convert a ...

Google Sheets LENB Function
google sheets lenb function1

This post will guide you how to use Google Sheets LENB function with syntax and examples. Description The Google Sheets LENB function returns the length of a text string in bytes. The LENB function can be used to count the ...

Google Sheets LEN Function
Google sheets len function1

This post will guide you how to use Google Sheets LEN function with syntax and examples. Description The Google Sheets LEN function returns the length of a text string (the number of characters in a text string). The LEN function ...

Google Sheets LEFTB Function
google sheets leftb function

This post will guide you how to use Google Sheets LEFTB function with syntax and examples. Description The Google Sheets LEFTB function returns a substring (a specified number of the bytes) from a text string, starting from the left portion. ...

Google Sheets LEFT Function
google sheets left function

This post will guide you how to use Google Sheets LEFT function with syntax and examples. Description The Google Sheets LEFT function returns a substring (a specified number of the characters) from a text string, starting from the leftmost character. ...

Google Sheets JOIN Function
Google sheets join function

This post will guide you how to use Google Sheets JOIN function with syntax and examples. Description The Google Sheets JOIN function joins two or more text strings together and separated by a delimiter. you can select an entire range ...

Google Sheets FIXED Function
google sheets fixed function1

This post will guide you how to use Google Sheets FIXED function with syntax and examples. Description The Google Sheets FIXED function rounds a number to the specified number of decimal places and returns the result as text string and ...

Sidebar