How to Remove Spaces in Excel

In this tutorial, I will show you two ways to remove spaces in Excel.

1. Using TRIM function.
2. Using Find and Replace.

#1 Using TRIM Function 
excelentp.blogspot.in
Excel TRIM function removes the leading and trailing spaces, and double spaces between text strings.

For example, in the above example, to remove spaces from the entire list if first names (in A2:A7), use the following formula in cell C1 and drag it down for all the first names:

=TRIM(A2)

Excel TRIM function would instantly remove all the leading and trailing spaces in the cell.

Once you have the cleaned data, copy it paste it as values in place of the original Data.


This function is also helpful if you have more than one space character between words.It would remove the extra spaces such that the result always have one space character between words.



Excel TRIM function does a good job in removing spaces in Excel, however, it fails when you have non-printing characters (such as line breaks) in your data set. To remove non-printing characters, you can use a combination of TRIM and CLEAN functions.

If you have some text in cell A1 from which you want to remove spaces, use the below formula:

=TRIM(CLEAN(A1)) 

Non-printing characters can also result from =CHAR(160), which can not be removed by the CLEAN formula. So, if you want to be absolutely sure that you have all the extra spaces and non-printing characters, use the below formula:

=TRIM(CLEAN(SUBSTITUTE(A1,CHAR(160),” “)))

#2 Remove Spaces in Excel using FIND and REPLACE

You can remove spaces in Excel using the Find and Replace functionality.

This is a faster technique and can be useful in the given situations:


  • When you want to remove double spaces.
  • When you want to remove all the space characters.

Comments

Popular posts from this blog

How to Hide Formula in Excel

How to Automatically Add Serial Numbers in Excel

Delete Blank Rows in Excel