TRIM practice exercises

Removes the spaces before and after text, and collapses repeated spaces inside it. Below is 1 interactive exercise that puts it to work on realistic business data — you write the formula, and get told exactly what went wrong when it does not work.

1 free TRIM exercise · about 4 minutes · no sign-up · runs in your browser

First up: Strip stray spaces from item codes with TRIM (4 min). The sheet holds the data for every TRIM exercise on this page, with the answer cells blank; the feedback and the solution are in the browser exercise.

Syntax

TRIM(text)

Need a refresher? Learn TRIM — syntax, a worked example and where it goes wrong.

On your own sheet? Try the Data Cleaner.

Last updated

Practise TRIM

Ordered from most approachable to hardest.

When TRIM is the right tool

Removes the spaces before and after text, and collapses repeated spaces inside it. It belongs to the text functions family, and it shows up constantly in real work — which is why it is worth being genuinely fluent rather than merely familiar.

Reading about a function is not the same as being able to write it. The exercises on this page exist because the gap between recognising TRIM and producing it from memory, correctly, on data you have not seen before, only closes by doing it.

Questions about TRIM

Where can I find free TRIM practice exercises with answers?

Here: 1 TRIM exercise on realistic business data, free and with no sign-up. You write the formula in a real spreadsheet grid and the checker says exactly what went wrong. A hint or another go is offered first, and the full solution, with an explanation of why it works, is always one click away.

Is there a TRIM practice sheet I can download?

Yes. The TRIM practice sheet is a CSV with the data for every TRIM exercise on this page, and the answer cells left blank. It is free, needs no sign-up and opens in Excel; use Save As and choose Excel Workbook (.xlsx) to keep your work. Feedback on a wrong answer, and the solution, are in the browser exercise. Teachers may share the file under CC BY 4.0 with credit.

How do I practise TRIM without Excel installed?

Every exercise on this page runs in your browser. You type the TRIM formula into a real spreadsheet grid and get told immediately whether it works — no download, no account.

What does TRIM do?

Removes the spaces before and after text, and collapses repeated spaces inside it. The syntax is TRIM(text). The exercises below put it to work on realistic business data rather than abstract examples.

How long does it take to learn TRIM?

Most people can write a working TRIM formula within twenty minutes of practice. Getting it right under pressure — with edge cases, unsorted data and ranges that must survive being filled down — is what the harder exercises here are for.