Remove Extra Spaces in Your Google Sheets Data - WindowsTips.net - Windows Tips and Tricks with Geek

Wednesday, October 27, 2021

Remove Extra Spaces in Your Google Sheets Data

 

Remove Spaces Using Trim Whitespace

If you want to remove the spaces within your text and keep that data in the existing cells, you can use the handy Trim Whitespace feature.

Select the cells with the text you want to remove the spaces from. Then click Data > Trim Whitespace from the menu.

Click Data, Trim Whitespace in Google Sheets

You’ll see a pop-up message letting you know the number of cells that were trimmed. Click “OK.”

Selected cells trimmed message

And just like that, those extra spaces vanish!

Whitespace trimmed in Google Sheets

Remove Spaces Using the Trim Function

You can also use the TRIM function in Google Sheets to remove excess spaces in your text. With this function, you can select the cell containing the text or enter the text you want to adjust.

Trim Cells

Select a cell where you want to place the function. This is also the cell where the result will display. Then enter the following replacing the A2 cell reference with your own.

=TRIM(A2)

Trim function for a cell

Press Enter or Return and you’ll see the result in the function’s cell. It should display the text from your referenced cell without any extra spaces.

Trim function for a cell result

Trim Text

Another way to use the TRIM function is for specific text. As with the former, select a cell for the function and note that this places the result in that same cell. Then enter the following replacing the text with your own inside quotes.

=TRIM("  Marge    Simpson   ")

Trim function for text

Press Enter or Return and you’ll see the result in the function’s cell. Again, this should provide you with text that doesn’t contain leading, repeated, or trailing spaces.

Trim function for text result

To avoid issues with validation or formulas in Google Sheets, or to simply ensure a consistent appearance, remember these methods for removing extra spaces in your text.

No comments:

Post a Comment