CHAR Function in Google Sheets helps you return a character corresponding to a numeric character code. Somewhat like below:
In this tutorial we will go through the basics of CHAR Function and discuss its various applications.
Syntax and Parameter Definition
table_number :- The number of the character to look up from the current Unicode table.
CHAR Function looks up the table_number in the Unicode Table and returns the corresponding character output.
Two more points can also be derived from the above example. In case a non-numerical value like ‘abc’ is provided then CHAR returns a ‘#VALUE’ error. If a null value is provided then we get an ‘#NUM’ error.
For more information on UNICODE mapping visit the link
CODE Function Explained
Before moving on to examples it’s worth discussing CODE Function. It’s opposite of CHAR Function which returns the Unicode Numerical Value of the supplied Character or Symbol. See examples below:
So, incase you were looking for an easy way to get the Numerical Unicode Mapping for any Character then CODE function will be helpful. You can read more about CODE Function here.
Example and Applications of CHAR Function
CHAR Function provides a great deal of utility to help handle multiple scenarios relating to Text/Cell Formatting. Let’s review couple of them below.
Inserting Special Characters
There’s only so much of a character range a normal keyboard can cover. For everything else you either go searching online to copy-paste or alternatively can use the CHAR Function if you know the right UNICODE mapping number.
Adding Line Breaks within a Cell
Adding line breaks can really be a tricky task within a cell. You need to carefully press ALT+Enter before moving to next line. Which is not very easy at times.
CHAR Function again comes to rescue. In the below example we want to merge first three columns into the fourth, separated by line breaks. We can easily do it using CHAR(10).
Adding Superscripts and Subscripts
A corner use-case is to add Superscripts and Subscript to your existing cell. This is immensely powerful when you wish you write mathematical formulas or chemical equations.
- It takes in Unicode Numerical Value and returns the corresponding character for the supplied input
- CODE Function just performs the opposite function to CHAR
- It will return in an error output if non-numerical value is fed in the input
- You can use it to insert special characters, add superscripts/subscript, add line breaks etc
That’s it on this topic. You may drop a comment below in case of any more questions. Keep browsing SheetsInfo for more such useful information 🙂