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)
  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 Cell Cleaner add-in

If you often import data to Excel from external sources and spend much time polishing up your tables, check out Cell Cleaner add-in for Excel.

This helpful tool will clean data imported from 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. This add-in also converts words to UPPER, lower or Proper Case. And if you need to change text numbers back to number format and delete apostrophes, this will not be a problem.

  1. Download and install Cell Cleaner add-in 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
     Go to Ablebits Data tab and click on the Trim Spaces icon
  4. The Cell Cleaner 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.
    Trim spaces using Cell Cleaner Add-in

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

You may also be interested in:

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

  1. One Guy says:

    Just wanted to give my thanks. That SUBSTITUTE command just saved 2 days of data inputting in a 2000 rows spreadsheet.

  2. Suzanne Walker says:

    Is there a formula or a function that can be placed into a cell in excel that will automatically restrict space entery, at the time that data is being entered, to 1 space between characters.
    Also how would I lock the formulas in cells, so they cannot be changed but allow data entery into the cell.
    Many thanks

    • cbyjpr says:

      You can lock cells easily enough. Just right click the cell (or group of cells) and select format cells. Go to the protection tab and check the locked box. Note by default ALL cells are typically set. So really you have to unlock the cells you want to be able to change.
      After you've made your sections go to file -> protect workbook. You can select a workbook, sheet whatever... once you've done that the cells will not be changeable unless you go back and undo the protection again via file -> protect. Optionally you can put a password on the protection to keep users out of modifications.

  3. Bet says:

    I can still see trailing spaces on my spreadsheets after removing them via Find and replace method. Please help

    • Mokhschild says:

      I had the same issue. Here is what u can do, select (highlight) the "space" after the data and copy (ctrl+c). Then in find and replace, paste (ctrl+v) the "space" that u have copied into the "Find What" and leave the "Replace With" empty.
      Good Luck!

  4. Venkataratnam says:

    How to remove spaces in excel
    Ex: i have an excel sheet which is in 10 thousand phone numbers in a sheet but the sheet having more spaces.spaces means not a front space and back space,only space from up or above space
    like phone number above space and number like this 9999999999,how to remove above space
    9999999999----> phone number
    Please tell me the formula

  5. Marius says:

    625 749.41
    2 260 216.41
    570 246.96
    308 608.25
    2 084.46
    42 840.00
    206 271.99
    772 026.85
    26 735.61
    1 493 364.26
    193 150.50

  6. Mar says:

    how do I convert these to numbers

    625 749.41
    2 260 216.41
    570 246.96
    308 608.25
    2 084.46
    42 840.00
    206 271.99
    772 026.85
    26 735.61
    1 493 364.26
    193 150.50

  7. Steven P Brown says:

    This article saved me alot of time and frustration.

    • Oytisa Onato says:

      1. select the whole column or the cell you want to convert to numbers
      2. Right click and then press "Format Cells"
      3. click on "Numbers" and adjust the number of decimals you want in the 'Decimal Places'

  8. aditya says:

    2415927226.30 how to remove top space??

  9. Santy Tanwar says:

    37820-55C -D250M1

    How can i remove space b/w 55c to hyphen with a formula
    pls suggest any formula below are more code
    37820-55C -D250M1
    37820-55C -D550M1
    37820-55C -D850M1
    37820-55C -N040M1
    37820-55C -N210M1
    37820-55C -N550M1
    37820-55C -N650M1
    37820-55C -N710M1
    37820-5V6 -D810M1
    37820-5XJ -E110M1
    37820-5XJ -E210M1
    37820-5XJ -E511M1
    37820-5XJ -N010M1
    37820-5XJ -N110M1
    37820-5XJ -N510M1
    37820-5XJ -N610M1

  10. Femi says:

    This will save me a huge problem from my boss. Huge data supplied came with spaces between phone numbers and we needed to contact them via SMS. Thanks in advance

  11. shonam says:

    how can remove this space

  12. Abder-Rahman says:

    A very handy way to remove spaces. Thanks so much, and keep it up.

Post a comment

Unfortunately, due to the volume of comments received we cannot guarantee that we will be able to give you a timely response. When posting a question, please be very clear and concise. We thank you for understanding!
Ultimate Suite 2018.5 for Excel
60+ professional tools for Excel 2019-2007 to do your daily work
Incredible product, even better tech support…AbleBits totally delivers!
Deborah Bryant
Anyone who works with Excel is sure to find their work made easier
Jackie Lee
The best spent money on software I've ever spent!
Patrick Raugh
Ablebits is a fantastic product - easy to use and so efficient.
Debra Celmer
Excel is at its best now
Annie C.
I don't know how to thank you enough for your Excel add-ins
Jennifer Morningstar
Anybody who experiences it, is bound to love it!
Kumar Nepa
AbleBits suite has really helped me when I was in a crunch!
Nelda Fink
I have enjoyed every bit of it and time am using it
Christian Onyekachi Nwosu
It's the best $100 we've ever spent!
Mike Cavanagh
I love the program, and I can't imagine using Excel without it!
Robert Madsen
One word… WOW!
Dave Brown
Love the products!
David Johnston
It is like having an expert at my shoulder helping me…
Linda Shakespeare
Your software really helps make my job easier
Jeannie C.
Thanks for a terrific product that is worth every single cent!
Dianne Young
I love your product
Brad Gibson
Sheila Blanchard