In this article:

Google Sheets TRIM Function (Easiest Way to Use It in 2024)

November 14, 2024

Google Sheets TRIM Function

The Google Sheets TRIM function is used to remove extra spaces from text except for single spaces between words. This means it will eliminate leading and trailing spaces, as well as any extra spaces in between the words of the text which leaves only one space between each word.

Syntax

The syntax of the TRIM function is:

TRIM(text)

text is the string or reference to a cell containing the text you want to clean up.

How to Use the TRIM Function in Google Sheets

Follow the steps below to use the TRIM function in Google Sheets. 

1. Choose the Cell for Cleaned Text Output

Click on the cell where you want to display the cleaned text, such as B1 next to your first text entry.

google sheets trim

2. Input the TRIM Function Formula

Type =TRIM( into the selected cell to start the function for cleaning text.

trim google sheets

3. Add the Reference of the Cell You Want to Clean

Specify the cell reference containing the text you want to clean. For example, input =TRIM(A1) to clean the text in cell A1.

trim function google sheets

4. Complete the Function with a Closing Parenthesis and Press Enter

Finish your formula with a ) and press Enter. Extra spaces from the reference cell should now be removed.

google sheets trim function

5. Duplicate the TRIM Function for Other Cells

Copy the TRIM function from B1 and paste it into cells B2 through B5, adjusting the cell references as necessary.

trim in google sheets

6. Verify the Cleaned Text in All Applied Cells

Review the cells with the TRIM function applied. Ensure that extra spaces are removed from the text.

We hope that you now have a better understanding of how to set up Google Sheets TRIM function. If you enjoyed this article, you might also like our article on how to clear contents in Google Sheets or our article on how to use Google Sheets offline.

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->