How to Remove Leading Spaces in Microsoft Excel
![remove space in excel remove space in excel](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/09/microsoft_excel_hero_1200x675.jpg?resize=400%2C225&ssl=1)
Copying text in Microsoft Excel is often annoying, and it’s tedious to manually remove trailing, leading, and any other extra spaces from cells in your spreadsheet. Fortunately, Excel has two features to remove them easily.
Table of Contentshow to delete whitespace in excel
In Excel, to remove leading, trailing and extra spaces between words in a particular string, use the TRIM function. This function removes all spaces except single spaces between words.
Remove Leading, Trailing and Extra Spaces in Excel
![remove spaces in excel remove spaces in excel](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/1-extra-space-spreadsheet.png?resize=400%2C146&ssl=1)
Select the cell next to the first record in your spreadsheet. This is where your text will appear without the extra space.
![remove space excel remove space excel](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/2-select-cell-1.png?resize=400%2C159&ssl=1)
In the selected cell, type the following TRIM function and press Enter. In the function, replace B2 with the cell where your first record is.=TRIM(B2)
![excel remove spaces excel remove spaces](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/3-enter-trim-function.png?resize=400%2C164&ssl=1)
From the lower-right corner of where you typed the TRIM function, drag down to copy the formula to all of your records.
![space remove in excel space remove in excel](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/4-copy-trim-function.png?resize=400%2C162&ssl=1)
You now have your text in your spreadsheet without any extra spaces.
![how to remove space in excel how to remove space in excel](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/5-remove-spaces-cells.png?resize=400%2C160&ssl=1)
Are there any duplicate rows in your spreadsheet? If so, removing them is easy. RELATED: How to Remove Duplicate Rows in Excel How to Remove All Spaces in Excel
![excel remove space excel remove space](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/6-select-cells-with-spaces.png?resize=400%2C168&ssl=1)
![excel Menu option excel Menu option](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/7-excel-home-tab.png?resize=400%2C125&ssl=1)
In the “Home” tab, from the “Editing” section, select the “Find and Select” option.
![Excel find and replace option Excel find and replace option](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/8-excel-find-select.png?resize=400%2C228&ssl=1)
From the expanded menu, select “Replace”.
![removing space in excel by replace option removing space in excel by replace option](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/9-excel-replace-feature.png?resize=400%2C296&ssl=1)
![how to remove spaces in excel before text how to remove spaces in excel before text](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/10-replace-spaces-excel.png?resize=400%2C206&ssl=1)
![how to remove extra spaces in excel how to remove extra spaces in excel](https://i0.wp.com/www.howtogeek.com/wp-content/uploads/2021/11/11-spaces-removed-excel.png?resize=400%2C167&ssl=1)
And that’s how you keep your entries neat and tidy by removing any unwanted whitespace! Need to remove blank rows or columns from your Excel spreadsheets? There are easy ways to do this.