Text
Modern
TRIM
Removes extra spaces from text, leaving single spaces between words.
Available in All versions
Syntax
TRIM(text)What it returns
The text with surplus spaces removed.
Arguments
| Argument | Required | Description |
|---|---|---|
text |
Yes | The text to clean. |
Example
Before
␣␣Hello World␣␣
→
After
Hello World
TRIM removes spaces before and after, and extra spaces between words.
=TRIM(A2)Important to know
Removes leading, trailing and repeated inner spaces — keeps single spaces between words.
Does not remove non-breaking spaces (CHAR(160)); replace them with SUBSTITUTE first, then apply TRIM.


