How to Remove Spaces in Microsoft Excel

How to Remove Spaces in Microsoft Excel

How to Remove Spaces in Microsoft Excel

When you copy text into Microsoft Excel, it’s common to get unpleasant leftover whitespace, and manually removing trailing, leading, and other additional spaces from the cells in your spreadsheets is time-consuming. Fortunately, Excel offers two tools that make removing them a breeze.

Delete Whitespace in Excel

Use the TRIM function in Excel to remove the leading, trailing, and extra spaces between words in a string. Except for single spaces between words, this function removes all spaces.

Use Excel’s Replace tool to remove all spaces, including those between words. You may do this rapidly across your entire spreadsheet or just a section of it.

How to Remove Spaces in Microsoft Excel including Leading, Trailing, and Extra Whitespaces

Open your spreadsheet in Microsoft Excel to begin deleting the leading, trailing, and excess whitespaces from your cells. We’ll utilize the spreadsheet below, which contains more spaces.

In your spreadsheet, choose the cell next to the first record. This is where your text will display without the extra spaces.

Type the following TRIM function in the selected cell and hit Enter. Replace B2 with the cell that contains your first record in the function.


Drag down from the bottom-right corner of where you typed the TRIM function to copy the formula to all your records.

In your spreadsheet, you now have your text without any extra spaces.

How to Remove All Spaces in Excel

Use Excel’s Replace function to remove all whitespaces from your spreadsheet, as seen below.

To begin, open your spreadsheet and pick the cells you wish to delete spaces from.

Click the “Home” tab in Excel’s ribbon at the top.

Select the “Find & Select” option from the “Editing” section of the “Home” tab.

Select “Replace” from the expanded menu.

A “Find and Replace” window will appear in Excel. Here, type a space in the “Find What” box. Fill in the “Replace With” field with nothing. Then, at the bottom of the window, click “Replace All.”

All spaces in your worksheet will be found and deleted by Excel.

Tip: If you make a mistake, click Ctrl+Z on Windows or Command+Z on Mac to immediately restore your spacing.

Leave a Reply

Your email address will not be published.