← ACARA Digital Technologies Years 9–10

CODE and CHAR functions in a spreadsheet

Gives the number code of a letter, so =CODE("A") returns 65. Its partner =CHAR(65) turns a code back into a letter. Capital letters start at 65 (A) and run to 90 (Z).

Understanding CODE and CHAR functions in a spreadsheet in ACARA Digital Technologies Years 9–10

What it does: CODE can take a cell reference, so it gives the number code of the letter in A2. Capital letters run from 65 (A) to 90 (Z), so CHAR(90) returns Z. CHAR(65) converts the code 65 into the letter A. It is the reverse of =CODE("A"). CODE("A") is 65. Adding 1 gives 66, and =CHAR(66) is B. Adding 2 would give 67, which is C. CHAR works from number to letter, so giving it a letter is the wrong way round.

Common mistakes: There is no CHR function in a spreadsheet. The function that gives a letter's number code is CODE, so the line should be B2: =CODE(A2). A letter typed straight into CODE must be inside quotes. Without quotes, the spreadsheet reads C as a name and gives an error. It should be =CODE("C").

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 860–875) and word search (Modules 860–944).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What does =CODE("A") return in a spreadsheet?
165
Matches
=CODE(A)
↓
The letter A is not in quotes, so the spreadsheet treats it as a name, not text. It should be =CODE("A") or a cell like =CODE(A2).
Applying
Meanings
Term
=CODE("A")
Meaning
Gives the number code of a letter, so =CODE("A") returns 65. Its partner =CHAR(65) turns a code back into a letter. Capital letters start at 65 (A) and run to 90 (Z).
Practice
=CODE(A2)&" is "&CHAR(65)
Testing
Gaps
=("A")
Check Answer
Spots
1A2: H
2B2: =CHR(A2)

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Sea Turtle' badge — Scope Navigator, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What does =CODE("A") return in a spreadsheet?
A. 65 ✓
B. 1
Upper-case letters use number codes starting at 65, so =CODE("A") gives 65, not 1.
2. Which formula turns the number 66 back into a letter?
A. =CHAR(66) ✓
B. =CODE(66)
CHAR turns a number code into a character. CODE goes the other way, from a letter to a number. =CHAR(66) returns B.
3. What does =CHAR(65) return?
A. 65
B. A ✓
CHAR(65) converts the code 65 into the letter A. It is the reverse of =CODE("A").
4. Cell A2 holds the letter C. Which formula gives its number code?
A. =CHAR(A2)
B. =CODE(A2) ✓
CODE reads a letter and returns its number. =CODE(A2) gives 67 for C. CHAR would expect a number, not a letter.
5. Which code is the LAST upper-case letter, Z, given by =CODE("Z")?
A. 90 ✓
B. 91
Capital letters run from 65 (A) to 90 (Z). That is 26 letters in total.

Match the Pairs

=CODE("A") → Returns the number code of the letter A, which is 65
=CHAR(66) → Returns the letter that has the number code 66, which is B
Find the number code of the letter stored in cell A2 → =CODE(A2)
Turn the number 90, the code for the last capital letter, back into a letter → =CHAR(90)
=CODE(A) → The letter A is not in quotes, so the spreadsheet treats it as a name, not text. It should be =CODE("A") or a cell like =CODE(A2).
=CHAR("A") → CHAR needs a number code, not a letter. To get a letter use =CHAR(65), or use =CODE("A") to get the number.

Key Term

=CODE("A")
Gives the number code of a letter, so =CODE("A") returns 65. Its partner =CHAR(65) turns a code back into a letter. Capital letters start at 65 (A) and run to 90 (Z).

Fill in the Blanks

1. =CODE("A")
Hint: Type the function name that returns the number code of a letter.
2. =CHAR(65)
Hint: Type the number code where the upper-case alphabet begins, so the formula returns the letter A.
3. =CHAR(66)
Hint: Type the function name that turns a number code back into a character.
4. =CHAR(CODE(A2)+1)
Hint: Type the function that first changes the letter in cell A2 into its number code.
5. =CHAR(90)
Hint: Type the number code of the last upper-case letter, Z.

Spot the Error

Question 1
A A2: H
B B2: =CHR(A2)
C C2: =CHAR(B2)
Line B — There is no CHR function in a spreadsheet. The function that gives a letter's number code is CODE, so the line should be B2: =CODE(A2).
Question 2
A Goal: find the code for C
B =CODE(C)
C Result: 67
Line B — A letter typed straight into CODE must be inside quotes. Without quotes, the spreadsheet reads C as a name and gives an error. It should be =CODE("C").
Question 3
A Goal: turn 70 into a letter
B Cell A2 holds 70
C =CODE(A2)
Line C — CODE turns a letter into a number, but this goal needs a number turned into a letter. Use CHAR: =CHAR(A2) gives F.
Question 4
A A2: D
B B2: =CODE(A2)
C C2: =B2+1
D D2: =CHAR("C2")
Line D — Quotes around C2 make it plain text, not a cell reference, so CHAR gets no number and gives an error. It should be D2: =CHAR(C2), which gives E.
Question 5
A =CHAR("A")
B Result: 65
C Next letter: =CODE("B") is 66
Line A — CHAR needs a number, not a letter, so =CHAR("A") gives an error. To get 65 from the letter A, use =CODE("A").

Student with a class code? Join your class →