← ACARA Digital Technologies Years 9–10

Length checking with LEN

LEN counts the characters in a cell, spaces included. Comparing it to a number, like =LEN(A2)=4 for a 4-digit postcode, gives TRUE if the length is right and FALSE if not.

Understanding Length checking with LEN in ACARA Digital Technologies Years 9–10

What it does: A 4-digit postcode needs a length of exactly 4, so LEN(A2) is compared with 4 using =. TRIM removes extra spaces before LEN counts, so a postcode typed with a stray space is still measured correctly. LEN(A2) returns the number of characters. Comparing it with =4 gives TRUE or FALSE, which is what a check needs. LEN counts every character in the cell, including spaces at the start, middle or end. The >= operator checks the LEN result is 8 or more, which is how a minimum length check works. LEN should only contain the cell to measure. The comparison with 4 belongs outside the brackets.

Common mistakes: Spreadsheets have no LENGTH function. The function that counts characters is LEN, so the line should be =LEN(A2)=4. The comma between the TRUE result and the FALSE result is missing. It should be =IF(LEN(A4)=4,"OK","Check").

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 255–329) and word search (Modules 226–329).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which formula checks that the postcode in A2 has exactly 4 characters?
=LEN(A2)=4=LEN(A2)+4
Matches
=LEN(A2=4)
↓
The =4 comparison is inside the brackets, so LEN is given a TRUE or FALSE value instead of the cell. The comparison must go after the closing bracket: =LEN(A2)=4.
Applying
Meanings
Term
=LEN(A2)=4
Meaning
LEN counts the characters in a cell, spaces included. Comparing it to a number, like =LEN(A2)=4 for a 4-digit postcode, gives TRUE if the length is right and FALSE if not.
Practice
=IF(LEN(A3)=4,"Valid","Invalid")
Testing
Gaps
=(A2)=4
Check Answer
Spots
1=LENGTH(A2)=4
2=LEN(A3)=4

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

The 'Butterfly' badge — Branch Hopper, 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. Which formula checks that the postcode in A2 has exactly 4 characters?
A. =LEN(A2)=4 ✓
B. =LEN(A2)+4
LEN(A2) returns the number of characters. Comparing it with =4 gives TRUE or FALSE, which is what a check needs.
2. A2 contains 3000. What does =LEN(A2)=4 return?
A. FALSE
B. TRUE ✓
3000 has 4 characters, so the length matches 4 and the check returns TRUE.
3. A2 contains 300. What does =LEN(A2)=4 return?
A. FALSE ✓
B. TRUE
300 has only 3 characters. That is not 4, so the check returns FALSE. A postcode this short would be rejected.
4. A2 contains the text 'Hi there'. What does =LEN(A2) return?
A. 8 ✓
B. 7
LEN counts spaces as characters. 'Hi' (2) + space (1) + 'there' (5) = 8.
5. A2 contains 3 0 0 (with a space between each digit, so 5 characters). What does =LEN(A2)=4 return?
A. TRUE
B. FALSE ✓
The two spaces are counted as characters, so the length is 5, not 4. LEN can catch stray spaces in a postcode.

Match the Pairs

=LEN(A2)=4 → Gives TRUE only if the postcode in A2 has exactly 4 characters
=LEN(B2)>=8 → Gives TRUE if the text in B2 meets a minimum length of 8 characters
Check that a postcode in cell A2 has exactly 4 characters → =LEN(A2)=4
LEN counts spaces, so test a trimmed value to ignore extra spaces → =LEN(TRIM(A2))=4
=LEN(A2=4) → The =4 comparison is inside the brackets, so LEN is given a TRUE or FALSE value instead of the cell. The comparison must go after the closing bracket: =LEN(A2)=4.
=LEN(A2)="4" → The 4 is in quotes, so it is text, not a number. LEN gives a number, so the comparison will not match. It should be =LEN(A2)=4.

Key Term

=LEN(A2)=4
LEN counts the characters in a cell, spaces included. Comparing it to a number, like =LEN(A2)=4 for a 4-digit postcode, gives TRUE if the length is right and FALSE if not.

Fill in the Blanks

1. =LEN(A2)=4
Hint: Type the function that counts the characters in a cell.
2. =LEN(A2)=4
Hint: Type the comparison operator that checks the length is exactly equal to the number.
3. =LEN(A2)>=3
Hint: Type the operator that checks the length is at least the minimum.
4. =LEN("AB CD")=5
Hint: Type the number of characters in the text, counting the space.
5. =IF(LEN(A2)=4,"OK","Check")
Hint: Type the number of digits a valid Australian postcode must have.

Spot the Error

Question 1
A =LENGTH(A2)=4
B =LEN(A3)=4
C =LEN(A4)=4
Line A — Spreadsheets have no LENGTH function. The function that counts characters is LEN, so the line should be =LEN(A2)=4.
Question 2
A =IF(LEN(A2)=4,"OK","Check")
B =IF(LEN(A3)=4,"OK","Check")
C =IF(LEN(A4)=4,"OK" "Check")
Line C — The comma between the TRUE result and the FALSE result is missing. It should be =IF(LEN(A4)=4,"OK","Check").
Question 3
A =LEN(A2)>=8
B =LEN(A3)>=8
C =LEN(A4)<=8
Line C — A minimum length check needs >= so that 8 or more characters pass. <= would set a maximum instead, so it should be =LEN(A4)>=8.
Question 4
A =LEN(A2)=4
B =LEN(A3)=4
C =LEN(A4)=4
D =LEN(A5)="4"
Line D — Putting 4 in quotes makes it text, and LEN returns a number, so the comparison is always FALSE. It should be =LEN(A5)=4, without quotes.
Question 5
A =IF(COUNT(A2)=4,"OK","Check")
B =IF(LEN(A3)=4,"OK","Check")
C =IF(LEN(A4)=4,"OK","Check")
Line A — COUNT counts how many cells hold numbers, not how many characters a cell has. Use LEN: =IF(LEN(A2)=4,"OK","Check").

Student with a class code? Join your class →