Practice by topic / Excel / Text Functions

TRIM and CLEAN 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 clean up a messy name entry, combine trim and proper for clean formatting, trim whitespace from a pasted value.

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

1

Clean Up a Messy Name Entry

Free

A1 holds a name with extra leading/trailing spaces and doubled internal spaces. Write a formula in A2 that removes the extra spacing using TRIM.

A
1 John Smith
2?
Show the solution

Use =TRIM(A1).

Right — TRIM removes leading/trailing spaces and collapses internal double spaces to single spaces.

Expected result in A2: John Smith

Try it in the live spreadsheet →
2

Combine TRIM and PROPER for Clean Formatting

Free

A1 holds a messy name with extra spaces and inconsistent case. Write a formula in A2 that trims and proper-cases it in one formula.

A
1 jane DOE
2?
Show the solution

Use =PROPER(TRIM(A1)).

Good — wrapping TRIM inside PROPER fixes both the spacing and the capitalization in one step.

Expected result in A2: Jane Doe

Try it in the live spreadsheet →
3

Trim Whitespace From a Pasted Value

Free

A1 holds a numeric-looking value pasted with extra spaces around it, stored as text. Write a formula in A2 that trims it using TRIM.

A
1 42
2?
Show the solution

Use =TRIM(A1).

Right — TRIM is the standard first step when cleaning pasted data with stray whitespace.

Expected result in A2: 42

Try it in the live spreadsheet →
5

Remove Non-Printable Characters From Imported Text

A1 holds text imported from another system that contains a stray control character. Write a formula in A2 that returns the length after cleaning it with CLEAN, to confirm the control character was removed.

A
1Report\x01Draft
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 →
7

Combine TRIM and UPPER for a Clean Code

A1 holds a product code with extra spaces and lowercase letters. Write a formula in A2 that trims and uppercases it in one formula.

A
1 sku001
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

Combine TRIM and PROPER for a City Name

A1 holds a city name with extra spaces and inconsistent case. Write a formula in A2 that trims and proper-cases it in one formula.

A
1 NEW york
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 →