When you copy or download data from the internet, it often contains excessive unnecessary spaces. Manual removal of these spaces can be time-consuming. The TRIM function efficiently eliminates extra spaces, especially beneficial for handling large datasets.

This article describes the syntax and usage of the TRIM function in Excel.
Description
The TRIM function is designed to remove all spaces within the input text while retaining a single space between words.
It is useful when dealing with texts containing excessive extra spaces.
The TRIM function specifically eliminates 7-bit ASCII space characters from the text, excluding non-breaking space characters often used as HTML elements like in web pages.
Syntax
=TRIM(text)
Where:
text is the text or reference to the text you want to remove extra spaces from, a required parameter. You can directly input the text or reference it.
Example
Eliminate white spaces in the text 'Nguyen Van A'

Remove white spaces in the value cell within the text:

So the article has introduced the syntax and examples to help you understand how to use the TRIM function. Using the TRIM function is simple but effective, saving you a lot of time processing text. Wishing you success!
