When you work with Microsoft Excel, you might hear about something called ASCII.
ASCII stands for “American Standard Code for Information Interchange”
Think of ASCII as a secret code where every letter, number, and symbol on your keyboard is matched with a special number. This code lets computers and their programs, like Excel, exchange information with each other.
In Excel, you use ASCII to do all sorts of cool things. For example, if you want to find out the ASCII number for a certain character in your spreadsheet, you can use a function called UNICODE.
On the flip side, if you have an ASCII number and you’re curious about which character it stands for, the CHAR function comes into play. These two helpers are like translators between you and the secret language of your computer.
Let’s now have a look at some examples of using ASCII in Excel and see how it can make your Excel calculations more efficient.
How Excel Interprets ASCII
When you push a key on your keyboard, Excel doesn’t just see the letter or number; it sees an ASCII code.
This code is a number from 0 to 127 that represents characters, including:
- Numbers (0-9): Assigned codes 48 to 57
- Upper case letters (A-Z): Codes 65 to 90
- Lower case letters (a-z): Codes 97 to 122
- Punctuation: Such as
.
(a period), which has the code 46
These codes make it possible for Excel to show you the right letter or symbol on your screen.
ASCII Codes Table
Below is a table that lists all the ASCII numbers with the characters and the formula to get it.
Number | Character | Formula | Description |
---|---|---|---|
32 | =CHAR(32) | Space Character | |
33 | ! | =CHAR(33) | Exclamation Mark |
34 | “ | =CHAR(34) | Quotation Mark |
35 | # | =CHAR(35) | Number Sign |
36 | $ | =CHAR(36) | Dollar Sign |
37 | % | =CHAR(37) | Percent Sign |
38 | & | =CHAR(38) | Ampersand |
39 | =CHAR(39) | Apostrophe | |
40 | ( | =CHAR(40) | Left Parenthesis |
41 | ) | =CHAR(41) | Right Parenthesis |
42 | * | =CHAR(42) | Asterisk |
43 | + | =CHAR(43) | Plus Sign |
44 | , | =CHAR(44) | Comma |
45 | – | =CHAR(45) | Hyphen |
46 | . | =CHAR(46) | Period |
47 | / | =CHAR(47) | Slash |
48 | 0 | =CHAR(48) | Digit 0 |
49 | 1 | =CHAR(49) | Digit 1 |
50 | 2 | =CHAR(50) | Digit 2 |
51 | 3 | =CHAR(51) | Digit 3 |
52 | 4 | =CHAR(52) | Digit 4 |
53 | 5 | =CHAR(53) | Digit 5 |
54 | 6 | =CHAR(54) | Digit 6 |
55 | 7 | =CHAR(55) | Digit 7 |
56 | 8 | =CHAR(56) | Digit 8 |
57 | 9 | =CHAR(57) | Digit 9 |
58 | : | =CHAR(58) | Colon |
59 | ; | =CHAR(59) | Semicolon |
60 | < | =CHAR(60) | Less-Than |
61 | = | =CHAR(61) | Equals-To |
62 | > | =CHAR(62) | Greater-Than |
63 | ? | =CHAR(63) | Question Mark |
64 | @ | =CHAR(64) | At Sign |
65 | A | =CHAR(65) | Uppercase A |
66 | B | =CHAR(66) | Uppercase B |
67 | C | =CHAR(67) | Uppercase C |
68 | D | =CHAR(68) | Uppercase D |
69 | E | =CHAR(69) | Uppercase E |
70 | F | =CHAR(70) | Uppercase F |
71 | G | =CHAR(71) | Uppercase G |
72 | H | =CHAR(72) | Uppercase H |
73 | I | =CHAR(73) | Uppercase I |
74 | J | =CHAR(74) | Uppercase J |
75 | K | =CHAR(75) | Uppercase K |
76 | L | =CHAR(76) | Uppercase L |
77 | M | =CHAR(77) | Uppercase M |
78 | N | =CHAR(78) | Uppercase N |
79 | O | =CHAR(79) | Uppercase O |
80 | P | =CHAR(80) | Uppercase P |
81 | Q | =CHAR(81) | Uppercase Q |
82 | R | =CHAR(82) | Uppercase R |
83 | S | =CHAR(83) | Uppercase S |
84 | T | =CHAR(84) | Uppercase T |
85 | U | =CHAR(85) | Uppercase U |
86 | V | =CHAR(86) | Uppercase V |
87 | W | =CHAR(87) | Uppercase W |
88 | X | =CHAR(88) | Uppercase X |
89 | Y | =CHAR(89) | Uppercase Y |
90 | Z | =CHAR(90) | Uppercase Z |
91 | [ | =CHAR(91) | Left Square Bracket |
92 | \ | =CHAR(92) | Backslash |
93 | ] | =CHAR(93) | Right Square Bracket |
94 | ^ | =CHAR(94) | Caret |
95 | _ | =CHAR(95) | Underscore |
96 | ` | =CHAR(96) | Grave Accent |
97 | a | =CHAR(97) | Lowercase A |
98 | b | =CHAR(98) | Lowercase B |
99 | c | =CHAR(99) | Lowercase C |
100 | d | =CHAR(100) | Lowercase D |
101 | e | =CHAR(101) | Lowercase E |
102 | f | =CHAR(102) | Lowercase F |
103 | g | =CHAR(103) | Lowercase G |
104 | h | =CHAR(104) | Lowercase H |
105 | i | =CHAR(105) | Lowercase I |
106 | j | =CHAR(106) | Lowercase J |
107 | k | =CHAR(107) | Lowercase K |
108 | l | =CHAR(108) | Lowercase L |
109 | m | =CHAR(109) | Lowercase M |
110 | n | =CHAR(110) | Lowercase N |
111 | o | =CHAR(111) | Lowercase O |
112 | p | =CHAR(112) | Lowercase P |
113 | q | =CHAR(113) | Lowercase Q |
114 | r | =CHAR(114) | Lowercase R |
115 | s | =CHAR(115) | Lowercase S |
116 | t | =CHAR(116) | Lowercase T |
117 | u | =CHAR(117) | Lowercase U |
118 | v | =CHAR(118) | Lowercase V |
119 | w | =CHAR(119) | Lowercase W |
120 | x | =CHAR(120) | Lowercase X |
121 | y | =CHAR(121) | Lowercase Y |
122 | z | =CHAR(122) | Lowercase Z |
123 | { | =CHAR(123) | Left Curly Brace |
124 | | | =CHAR(124) | Vertical Bar |
125 | } | =CHAR(125) | Right Curly Brace |
126 | ~ | =CHAR(126) | Tilde |
Using ASCII in Formulas
In Excel, you can play with ASCII codes to make cool stuff happen in your worksheets. Two handy functions are:
- CHAR(number): Gives you the character for the ASCII code number. If you type =CHAR(65), Excel will show ‘A’.
- CODE(character): Does the opposite, telling you the ASCII code for a character. =CODE(“A”) will give you the number 65.
You can mix these with other formulas in Excel to do things like check if a letter in a cell is uppercase (=CODE(A1) >= 65 AND CODE(A1) <= 90) or to change letters and numbers around in a fun way.
Using ASCII to Insert a Line Feed in Formulas
Sometimes, when we’re working with formulas, we may need to include special characters. For instance, there are times when we want to insert a line break within a formula. When this happens, we can use ASCII codes.
Below, I have a dataset where I have the names in column A and the titles in column B.
To make name cards in Column C, I want to enter the person’s name first, and then underneath, I want to enter their job title.
To do that I can use the below formula.
=A2&CHAR(10)&B2
In the above formula, I have used CHAR(10) to enter a line feed.
Also read: How to Generate Random Letters in Excel?
Using ASCII to Insert Alphabet Letters
ASCII can be used to generate a list of alphabet letters.
Below, I have a table where I have the team number in column A. Now, in column B, I want to assign English letters to each team.
To do that I can use the below formula.
="Team "&CHAR(65+A2-1)
In the formula I used, CHAR(65) is what tells Excel to display the letter “A”, and CHAR(66) displays the letter “B”. So, if you’re setting up teams and assigning them letters, you can use these CHAR functions with ASCII codes to generate the letters you need.
Using ASCII to Create a Bullet List
While Microsoft Word has a built-in feature for creating bullet lists, Excel doesn’t have a direct method for inserting bullets. But you can still achieve this using ASCII codes.
To create a bullet list in column A, I can use the below formula.
=CHAR(149)&" List "&SEQUENCE(5)
In the above example, I have used CHAR(149) to insert a bullet point.
Use ASCII to Insert CheckMarks
Just like inserting bullet points using ASCII codes in Excel, you can also use ASCII codes to insert check marks.
Below, I have a checklist where I have the Project in column A and the progress percentage in Column B.
In column C, I want to enter a tick mark if the progress percentage is equal to 100%.
To do that, I can use the following formula.
=IF(B2=100%,CHAR(252),"")
To get the check mark, now I have to change the font type of the formula cells (Cells C2 to C5) to “Windings”.
Other Excel articles you may also like: