The TRIM function

Removes spaces from the start and end of a text and turns runs of spaces inside it into one.

Syntax

TRIM(text)
text
The text to clean up.

Examples

C1=TRIM(A2)
ABC
1NameAnna Berg
2 Anna Berg
C1=LEN(TRIM(A2))
ABC
1Name9
2 Anna Berg

Practice TRIM

Read the guide

Related functions