TRIM

Removes extra spaces from text.

How it’s written

TRIM(text)

Example

A
1Name
2 Amara Osei
=TRIM(A2)

Result: Amara Osei

Removes the outer spaces, and shrinks the inner gap to one.

Try it yourself

Open a live sheet with this example, and type the formula yourself. It takes a moment to load.

Worth knowing

When a lookup fails on a value that looks right, try TRIM first.

Practice it properly

Cleaning messy text gives you real tasks, with your formulas tested on data you haven’t seen.

Start the lesson

Guides that use TRIM

Related functions