Skip to content

How to Trim Whitespace in Google Sheets

In this article, I show you how to remove the whitespace from your data in Google Sheets.

What Is Whitespace?

Take a look at the data below.

Looking at the names, you can see that not all the text lines up. Some of the names have spaces in front, pushing them forward. Also, a few names have extra spaces after them, although these spaces are not visible.

The extra spaces before and after the text make up the whitespace.

How to Remove the Whitespace

To remove the whitespace from your data in Google Sheets, start by selecting the data.

Next, go to Data Data Cleanup > Trim Whitespace.

This action will remove any extra spaces from the selected cells resulting in clean and usable data.

Remove Whitespace With a Formula

You can also remove whitespace from any cell by using the TRIM function.

Just enter the following formula.


The TRIM function removes any spaces before or after the text within the referenced cell.

The TRIM function also removes any extra spaces between text values as well. So it will only leave a single space between multiple text values.

And these are the methods that you can use to trim and remove whitespace in Google Sheets.

This Post Has 2 Comments

  1. I could have used this a couple months ago with a project I was working on! I didn’t know about this formula or setting! Can you use these in Excel?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back To Top