Remove Spaces In Excel Before Text

And now you only need to replace values in the original column with trimmed values.
Remove spaces in excel before text. Trim a2 where a2 is the cell you want to delete spaces from. The easiest way to get rid of excess spaces is using the standard excel find replace option. The text we want is from cell a1 so in text select a1. Press space bar in the find what field and make sure the replace with field is empty.
If you also need to remove line breaks from cells you can add the clean function like so. In the new text type which means no spaces then click on ok. The trim function then takes over to remove extra spaces and returns the final text. Trim clean text the clean function removes a range of non printing characters including line breaks and returns cleaned text.
In cell b1 type substitute and go to formulas tab click on insert function option in excel to open the function dialog box. 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. 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. 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. In the find what field type two spaces. Select the entire column you want to clean. 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.