Premium exercise · Excel text and date functions
TRIM and LEN practice
Practice Excel TRIM and LEN by cleaning extra spaces from names and counting the characters that remain.
Column A has names with extra spaces at the ends and between words.
In column B, use TRIM to clean each name. In column C, use LEN on the cleaned name to count its characters.
Dataset
Starter sheet. Cells marked formula are where the formula goes.
| Row | A | B | C |
|---|---|---|---|
| 1 | Raw name | Clean | Length |
| 2 | Ada Lovelace | Formula goes in B2. formula | Formula goes in C2. formula |
| 3 | Grace Hopper | Formula goes in B3. formula | Formula goes in C3. formula |
| 4 | Alan Turing | Formula goes in B4. formula | Formula goes in C4. formula |
Hint
TRIM removes spaces at the ends and collapses repeated spaces between words to a single space.
Explanation
This exercise practices TRIM and LEN in Excel. The formula goes in B2, C2, B3, C3, B4, C4.
TRIM turns the messy names into Ada Lovelace, Grace Hopper, and Alan Turing. LEN counts those cleaned characters: 12, 12, and 11. The extra spaces are gone before the count.
The interactive sheet and a worked solution are part of Formula Drills Premium. The instructions and starter data on this page are the full problem.