FxFormula Drills

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.

Starter sheet for this exercise
RowABC
1Raw nameCleanLength
2 Ada Lovelace Formula goes in B2. formulaFormula goes in C2. formula
3 Grace HopperFormula goes in B3. formulaFormula goes in C3. formula
4Alan Turing Formula goes in B4. formulaFormula 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.

Solve this exercise

Practice this formula

Loading the practice grid…