The Excel TRIM function strips extra spaces from text, leaving only a single space between words and no space characters at the start or end of the text.
Purpose: Remove extra spaces from text
Return value: Text with extra spaces removed.
Syntax
=TRIM (text)
Arguments
text - The text from which to remove extra space.
Example:
=TRIM(" A stitch in time. ") // returns "A stitch in time."