Excel TRIM Function

Using the Excel TRIM Function


The Excel TRIM function will remove all spaces from text, except for a single space between words. TRIM is very useful when removing irregular spacing that may occur when you receive a file from another application.

Use TRIM with CLEAN to remove line breaks and extra spaces at the same time.


=TRIM (text)

Syntax Breakdown

Required. The text from which you want to remove spaces.

Usage Notes

TRIM will remove excess spaces from text and leave only a single space between words. Space characters at the start or end of text will be removed.

The function only removes the ASCII space character (32). The function does not remove the non-breaking space character (160) often found in web pages as an HTML entity.