TRIM Function - Excel
Overview
The TRIM function in Excel is a useful tool for removing extra spaces from a text string that aren’t just the single spaces between words. This function helps you clean up text data be eliminating leading spaces, trailing spaces, and multiple consecutive spaces within the text.
Example:
=TRIM(" Apple ")
Syntax:
=TRIM(text)
text
: This is the text string or cell reference containing the text you want to trim.
Example
In this example, the TRIM function removes all of the extra spaces from the string “Hiking is fun” and gives us an output of “Hiking is fun”.