3 ways to remove spaces between words / numbers in Excel cells

3 quick ways to remove extra spaces between words or delete all spaces from Excel cells. You can use trim formula, Excel Find & replace or special Excel add-in to clean up cells' content.

When you paste data from an external source to an Excel spreadsheet (plain text reports, numbers from web pages, etc.), you are likely to get extra spaces along with important data. There can be leading and trailing spaces, several blanks between words and thousand separators for numbers.

Consequently, your table looks disorderly and becomes difficult to use. It may be a challenge to find a customer in the Name column since you search for "John Doe" which has no excess spaces between the names while the way it looks in your table is "John Doe". Or numbers can't be summed up, and again extra blanks are the ones to blame.

In this article you'll find how to clean up your data.

Trim blanks between words to 1, remove trailing / leading spaces

For example, you have a table with 2 columns. In the column Name, the first cell contains "John Doe" written correctly without excess spaces. All other cells have extra blanks between the first and the last names. At the same time these cells have irrelevant blanks before and after the full names known as leading and trailing spaces. The second column is called Length and shows the number of symbols in each name: Excel table with leading and trailing spaces, spaces between words

Use the Trim formula to remove extra spaces

Excel has the Trim formula to use for deleting extra spaces from text. Below you can find the steps showing how to use this option:

  1. Add the helper column to the end of your data. You can name it "Trim".
  2. In the first cell of the helper column (C2), enter the formula to trim excess spaces =TRIM(A2) Excel trim formula delete spaces
  3. Copy the formula across the other cells in the column. Feel free to use some tips from Enter the same formula into all selected cells at a time.
  4. Replace the original column with the one that has the cleaned data. Select all cells in the helper column and press Ctrl + C to copy data to clipboard.

    Now pick the first cell in the original column and press Shift + F10 or the menu button  menu keyboard button. Then just press V. Replace the original column with the one that has the extra  spaces removed

  5. Remove the helper column.

    That's it! We deleted all excess blanks with the help of the formula trim(). Unfortunately, it's a bit time-consuming, especially if your spreadsheet is rather big. Remove spaces between words to 1, remove leading and trailing spaces

    Note. If after using the formula you still see extra spaces (the last cell on the screenshot), please have a look at If the TRIM function doesn't work.

Using Find & Replace to remove extra spaces between words

This option needs fewer steps, but allows only deleting excess spaces between words. Leading and trailing spaces will also be trimmed to 1, but will not be removed.

  1. Select one or several columns with the data to delete spaces between words.
  2. Press Ctrl + H to get the "Find and Replace" dialog box.
  3. Press the Space bar twice in the Find What field and once in Replace With
  4. Click on the "Replace all" button, and then press Ok to close Excel confirmation dialog. Use Excel Find & Replace to remove extra spaces between words
  5. Repeat step 4 until you see the message "We couldn't find anything to replace." :)

3 clicks to neat data with Trim Spaces tool

If you often import data to Excel from external sources and spend much time polishing up your tables, check out our Text tools for Excel.

The Trim Spaces add-in will clean data imported from the web or any other external source. It removes leading and trailing spaces, excess blanks between words, non-breaking spaces, line breaks, non-printing symbols and other unwanted characters. Also, there is an option to convert words to UPPER, lower or Proper Case. And if you need to change text numbers back to the number format and delete apostrophes, this will not be a problem either.

To remove all extra spaces in your worksheet, including excess paces between words, this is what you need to do:

  1. Download and install a trial version of Ultimate Suite for Excel.
  2. Select the range in your table where you want to remove excess spaces. For new tables, I usually press Ctrl + A to process all columns in a go.
  3. Go to Ablebits Data tab and click on the Trim Spaces icon. Click on the Trim Spaces icon to run the tool.
  4. The add-in's pane will open on the left side of your worksheet. Just select the needed checkboxes, click the Trim button and enjoy your perfectly cleaned table. All extra spaces are trimmed.

Isn't it faster than with the two previous tips? If you always deal with data processing, this tool will save you hours of precious time.

Remove all spaces between numbers

Suppose, you have a workbook with numbers where the digits (thousands, millions, billions) are separated with spaces. Thus Excel sees numbers as text and no math operation can be performed. Excel cells with numbers where the digits are separated with spaces

The easiest way to get rid of excess spaces is using the standard Excel Find & Replace option:

  • Press Ctrl + Space to select all cells in a column.
  • Press Ctrl + H to open the "Find & Replace" dialog box.
  • Press Space bar in the Find What field and make sure the "Replace with" field is empty.
  • Click on the "Replace all" button, and then press Ok. Voila! All spaces are removed. Remove all spaces between numbers

Using formula to remove all spaces

You may need to delete all blanks, like in a formula chain. To do this, you can create a helper column and enter the formula: =SUBSTITUTE(A1," ","")

Here A1 is the first cell of the column with numbers or words where all spaces must be deleted.

Then follow the steps from the part using formula to remove extra spaces between words to 1 Using formula to remove all spaces between numbers

Video: how to remove spaces in Excel


256 comments

  1. I am using someone elses spreadsheet with a load of imported/pasted data in it. I need to alter the numbers in the cells from output per hour to output per day. So essentially all i need to do is, for each cell *8, for 8 hours.

    Unfortuantly, each cell with numbers in it seems to have a 'space' after each number. This presents an error in the formula and will not times the data by 8. When i manually remove the 'space', everything works as it should.

    We are talking about thousands of cells i need to manually remove the 'space' after each bit of data in each cell. I have tried the methods above without success.
    Any help would be greatly appreciated.

    • And by 'after each number' i mean there is a space at the end of the data in each cell.

  2. I copied a list of dates from a site, however they pasted as 'general' text in my spreadsheet as there is a space at the end of each date. Ultimately I want to organise the dates by 'oldest to newest'. Selecting the column and changing it to 'date' doesn't do anything, I imagine because of the extra space at the end. I tried TRIM, SUBSTITUTE and replace all and none of it got rid of the spaces for me (it only seems to work on spaces in between words/numbers, but not at the end). As the list is 1200+ entries long it's a bit much to manually delete the spaces. Does anyone have a solution for this? Many thanks in advance

  3. how can i remove single spaces

  4. If you have a phone number in format 0X XXX XXX XXX, how do you remove spaces without dropping the zero at the start?

  5. Thank you so much for this content. It has greatly helped me to reduce errors while working with large data especially when comparing items in two different columns

  6. Thank you ­čÖĆ

  7. Awesome!!

  8. I have copied a table from outlook & there having some junk characters which are looks like space but not space actually.

    All ways for clean the value column are done, number format also applied but still calculation not possible.

    can you please support for the problem.

  9. How can I get rid of leading and trailing spaces in a cell with multiple lines of text? The TRIM function works for a cell with just one line of text

  10. Thank you so much!! Your tips saved me time from having to update, and I count...5636 rows of data!!!!! That would have taken me days to update.

  11. SO much Thanks with Respect and Gratitude

  12. Thanks a lot. it was a big help.

  13. You are a god whoever made this page; thank you so much you saved me so much time with space trimming

  14. I am looking for some help. I have a column of numbers with a ' before each number, however, there are a bunch of them that have what looks like a space and it is not tight against the left edge. I have tried the Trim function, but that does nor work. I am not sure as to how to fix this.
    Thank you

  15. I have an excel sheet which is received from my bank but amount column having spaces in start of the numbers i put the formula of SUBTITUTE and TRIM but cannot sum of total value of amount by selecting of column.

  16. Thanks, 3rd option im use

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)