0 of 62
Text·Lesson 34 of 62Pro

How to use TRIM in Google Sheets

Remove extra spaces

How TRIM works

TRIM removes spaces at the start and end of text and shrinks any run of spaces to one.

TRIM(text)
Example on this data
=TRIM(A4)→Priya Shah

Cleans up the name in row 4.

What you’ll do

You’re now on a messy contacts table. You’ll clean the extra spaces out of a name, which is often the first step when you import data from somewhere else.

Try it

Type =TRIM(A4) into G2 and press Enter. Watch what the sheet does.

The result will appear in G2.

G2
New shortcut

After you’ve run the formula, click the sheet and press Ctrl+Z Mac ⌘+Z to undo it, then Ctrl+Y Mac ⌘+Y to bring it back. (Undo.)

ABCDEFG
1Full nameEmailSKUNote
2 maria lopez maria.lopez@acme.comWID-2041-BLUCall back 555-0142
3james chenjchen@northwind.ioGAD-1180-REDSent invoice
4Priya Shahpriya@shahdesign.coWID-3307-GRNCall back 555-0199
5tom o'neiltom.oneil@acme.comBOX-0042-BLULeft voicemail
6Lena Park lena.park@globex.comGAD-2215-BLKCall back 555-0107
7sam reedsreed@northwind.ioWID-0918-REDMeeting Tue
Ctrl+/ shows the shortcuts