Arrow left
Back to product guides
Google Sheets Formulas

How to Trim Whitespaces in Google Sheets

In this article, you will learn how to remove extra spaces with the TRIM functionin Google Sheets. The function is beneficial when you need to clean up a data set as a preparation to use other functions such as COUNTIF or SUMIF.

How to use the TRIM formula in Google Sheets

  1. Type “=TRIM” or go to “Insert” “Function”“Text”“TRIM”.
  2. Select a text from which you remove extra whitespaces
How to insert the TRIM function from the menu bar in Google Sheets

The generic syntax is as follows:

“=TRIM(text)”

Text: You can refer to a cell containing a text you want to trim or type in the text directly.

The TRIM function can delete whitespaces in front of or at the end of a text string. It also removes the extra spaces between words to leave a single space.

Assume you are a marketing manager and looking at customer survey data. As each form was filled by an individual customer, you see typos, especially extraneous spaces in the customer’s name section. So, you want to clean them up by using the TRIM function.

How to use the TRIM formula in Google Sheets with an example

Another way to trim whitespaces

If the number of texts you will clean up is small, you can do it manually. However, if the number is large, instead of using the TRIM function, you can take the following approach: go to the “Data” tab → “Data cleanup”“Trim whitespaces”. The “Trim whitespaces” effect is the same as the TRIM function; it removes any spaces ahead of or at the end of text strings or takes extra whitespaces between two words to leave only single whitespace.

Learn how to do this step-by-step in the video below 👇

Do you need personal help?

Our team of real people are here to help you any time between 9am and 10pm GMT.
Check Icon
Email us at: founders@liveflow.io
Check Icon
Call us at +1 (415) 650-1711