The numbers returned by the CHAR function in Excel come from ASCII. ASCII stands for “American Standard Code for Information Interchange” and is a 7-bit character set that contains characters from 0 to 127.

The original ASCII specification encodes 128 characters into numbers ( see table below ). These include the numbers 0 to 9, lowercase a-z, uppercase A-Z, and punctuation. The first 31 characters are non-printing “control codes”, most of which are no longer used, with the exception of the carriage return (13), line feed (10), and tab (9).

ASCII codes in Excel

Excel contains two functions designed to work with ASCII codes: the CHAR function and the CODE function. To specify a character according to its ASCII number, you can use the CHAR function like this:

=CHAR(65) // returns "A"
=CHAR(13) // carriage return

To return the ASCII number for a character, you can use the CODE function :

=CODE("A") // returns 65

Note: The Unicode character set is widely used these days on the web and in modern applications. Unlike ASCII, Unicode is a standard designed to support all of the world’s languages, and has many thousands of characters. Excel has two functions designed to work with this extended character set: UNICHAR and UNICODE .

ASCII codes

The table below shows standard printable ASCII characters and codes. The second table shows non-printable control codes .

CharacterNumberNotes
32space character
!33exclamation mark
"34quotation mark
#35number sign
$36dollar sign
%37percent sign
&38ampersand
'39apostrophe
(40left parenthesis
)41right parenthesis
*42asterisk
+43plus sign
,44comma
-45hyphen
.46period
/47slash
048digit 0
149digit 1
250digit 2
351digit 3
452digit 4
553digit 5
654digit 6
755digit 7
856digit 8
957digit 9
:58colon
;59semicolon
<60less-than
=61equals-to
>62greater-than
?63question mark
@64at sign
A65uppercase A
B66uppercase B
C67uppercase C
D68uppercase D
E69uppercase E
F70uppercase F
G71uppercase G
H72uppercase H
I73uppercase I
J74uppercase J
K75uppercase K
L76uppercase L
M77uppercase M
N78uppercase N
O79uppercase O
P80uppercase P
Q81uppercase Q
R82uppercase R
S83uppercase S
T84uppercase T
U85uppercase U
V86uppercase V
W87uppercase W
X88uppercase X
Y89uppercase Y
Z90uppercase Z
[91left square bracket
\92backslash
]93right square bracket
^94caret
_95underscore
`96grave accent
a97lowercase a
b98lowercase b
c99lowercase c
d100lowercase d
e101lowercase e
f102lowercase f
g103lowercase g
h104lowercase h
i105lowercase i
j106lowercase j
k107lowercase k
l108lowercase l
m109lowercase m
n110lowercase n
o111lowercase o
p112lowercase p
q113lowercase q
r114lowercase r
s115lowercase s
t116lowercase t
u117lowercase u
v118lowercase v
w119lowercase w
x120lowercase x
y121lowercase y
z122lowercase z
{123left curly brace
|124vertical bar
}125right curly brace
~126tilde

ASCII control codes

The table below shows the first 31 characters in ASCII, which are non-printing control codes. These codes were originally intended to control devices, and are no longer used, with the exception of the carriage return (13), line feed (10), and tab (9).

CharacterNumberNotes
NUL0null character
SOH1start of header
STX2start of text
ETX3end of text
EOT4end of transmission
ENQ5enquiry
ACK6acknowledge
BEL7bell (ring)
BS8backspace
HT9horizontal tab
LF10line feed
VT11vertical tab
FF12form feed
CR13carriage return
SO14shift out
SI15shift in
DLE16data link escape
DC117device control 1
DC218device control 2
DC319device control 3
DC420device control 4
NAK21negative acknowledge
SYN22synchronize
ETB23end transmission block
CAN24cancel
EM25end of medium
SUB26substitute
ESC27escape
FS28file separator
GS29group separator
RS30record separator
US31unit separator
DEL127delete control character

The term “BigNum”, which stands for “Big Number”, is used to represent the largest allowed positive number in Excel, which is 9.99999999999999E+307

BigNum is used in certain lookup formulas constructed in a way to find the largest value that is less than or equal to a search value. Because BigNum is an improbably large value, the lookup will find the previous numeric value.

For example, you can use the following formula to find the position of the last numeric value in a column:

=MATCH(9.99999999999999E+307,range)

In practice, any improbably large value will do, so you could trim the above to:

=MATCH(9.99E+307,range)

The reason this works has to do with the default behavior of MATCH, which uses a binary search algorithm to find the largest value that is less than or equal to the search value in a range. In this (default) mode, MATCH assumes values are sorted in descending order. When BigNum is, by design, not found, MATCH returns the position of the last number in the range.

For more details, see: Last row in numeric data.

BigNum with other lookup functions

The BigNum approach can be used with other functions that support binary search, for example:

=MATCH(bignum,range,1)
=VLOOKUP(bignum,range,1,1)
=HLOOKUP(bignum,range,1,1)
=LOOKUP(bignum,range)

Note match type is set to 1 in the first three examples to explicitly set binary search, often referred to as approximate match.