Practice by topic / Excel / Text Functions

LEN Exercises

Imported data is messy: extra spaces, inconsistent capitals, codes glued together. Text functions clean and reshape it without retyping anything. These 10 exercises build up step by step, starting with check a username's length, validate a password length requirement, count characters in a product code.

3 of 10 free · no sign-up needed · graded on the formula you write

1

Check a Username's Length

Free

A1 holds a username. Write a formula in A2 that returns how many characters it has using LEN.

A
1coder123
2?
Show the solution

Use =LEN(A1).

Right — LEN counts every character in the string, including numbers and symbols.

Expected result in A2: 8

Try it in the live spreadsheet →
2

Validate a Password Length Requirement

Free

A1 holds a password. Write a formula in A2 that returns TRUE if it has at least 8 characters, using LEN.

A
1hunter22
2?
Show the solution

Use =LEN(A1)>=8.

Good — wrapping LEN in a comparison is the standard way to validate minimum length.

Expected result in A2: true

Try it in the live spreadsheet →
3

Count Characters in a Product Code

Free

A1 holds a product code. Write a formula in A2 that returns its character length using LEN.

A
1SKU-88213
2?
Show the solution

Use =LEN(A1).

Right — LEN works the same on codes with letters, numbers, and dashes.

Expected result in A2: 9

Try it in the live spreadsheet →
5

Count Digits Entered for a Phone Field

A1 holds a phone number as text. Write a formula in A2 that returns its length using LEN, to check for the expected 10 digits.

A
15125550199
2?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
8

Validate a Fixed-Length Code

A1 holds a code that should be exactly 6 characters. Write a formula in A2 that returns TRUE if it is exactly 6 characters, using LEN.

A
1AB1234
2?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
9

Count Characters Remaining for a Tweet-Style Limit

A1 holds a message, and the limit is 280 characters. Write a formula in A2 that returns how many characters remain using LEN.

A
1Just shipped a new feature!
2?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →