Remove Spaces In Excel Before Text
If the text in your column has extra spaces within the text not right before or right after you can quickly clean that text by using excel s search and replace feature.
Remove spaces in excel before text. In cell b1 type substitute and go to formulas tab click on insert function option in excel to open the function dialog box. If you also need to remove line breaks from cells you can add the clean function like so. Press ctrl h to open the find replace dialog box.
The text we want is from cell a1 so in text select a1. Select the entire column you want to clean. Press ctrl space to select all cells in a column.
And now you only need to replace values in the original column with trimmed values. Press enter key to get the result then drag auto fill handle over the cells you want to remove extra spaces from all of leading spaces and trailing spaces and extra spaces have been removed. The easiest way to get rid of excess spaces is using the standard excel find replace option.
Trim clean text the clean function removes a range of non printing characters including line breaks and returns cleaned text. In the find what field type two spaces. The trim function then takes over to remove extra spaces and returns the final text.
In the new text type which means no spaces then click on ok. Select a cell next to the cell you want to remove extra spaces from string type this formula. We want to remove extra spaces so in old text box type which means space.
As shown in the following screenshot the excel trim formula successfully eliminated all spaces before and after the text as well as consecutive spaces in the middle of a string.