How To Remove Unwanted Spaces in Excel with TRIM

An Excel worksheet can have numerous extra spaces for a variety of reasons, such as typing in extra spaces unintentionally or additional letters or numbers moving with data that has been copied and pasted or transferred out of a separate application.

When text is imported from the internet or another application into your Excel spreadsheet, it often leads to extra spaces before a text, in the middle of a text, or after a text value. Excel offers you a simple function called TRIM that can quickly clean up those unwanted spaces.

YouTube video
Instead of deleting extra spaces separately, you can use the TRIM function. TRIM will not only save time, but the function will also help you avoid the risk of losing any space that exists between the text. The TRIM function in Excel will look at all the information that you have entered into your Excel worksheet and determine if there are any extra spaces; if there are any extra spaces, the TRIM function will get rid of them.

To remove spaces from a cell containing Jerry Seinfeld (G4), click into another cell (in our video, cell J4 was used) and type the formula for TRIM:


Click the cell that needs to have the spaces removed. Close the formula with a bracket, and you will have the following formula =TRIM(G4). Press Enter. You should now have a better version of the data in cell J4 and the other cells.

You can also use TRIM to remove any extra spaces in a column of cells. Not only that, you will need to apply the formula you have already typed into the rest of the column by dragging the cursor over the cells you want to apply the formula. Having extra spaces in one or more cells can impact how the data can be used in your spreadsheet.

If your cells have extra spaces anywhere in the worksheet, you will have a difficult time sorting your data. When you use the TRIM function, all leading, trailing, and double spaces will be removed in the text string.

For more Excel tips and videos, contact Sydney Technology Solutions today.