A2oz

How Do I Remove Space in an Excel Cell?

Published in Excel 2 mins read

There are a few ways to remove spaces from an Excel cell, depending on the type of space you want to remove:

Removing Leading and Trailing Spaces

Leading spaces are spaces at the beginning of a cell, while trailing spaces are spaces at the end. You can remove these using the TRIM function:

  1. Select the cell or range of cells where you want to remove spaces.
  2. Type the following formula in the formula bar: =TRIM(A1) (replace A1 with the cell containing the text).
  3. Press Enter. The formula will remove leading and trailing spaces from the cell.
  4. Copy the formula down to the rest of the cells in your range.

Removing All Spaces

If you want to remove all spaces from a cell, including spaces within the text, use the SUBSTITUTE function:

  1. Select the cell or range of cells containing the text.
  2. Type the following formula in the formula bar: =SUBSTITUTE(A1," ","") (replace A1 with the cell containing the text).
  3. Press Enter. This will remove all spaces from the cell.
  4. Copy the formula down to the rest of the cells in your range.

Removing Specific Spaces

If you want to remove only specific spaces, for example, spaces between words, use the FIND and REPLACE functions together:

  1. Select the cell or range of cells containing the text.
  2. Use the FIND function to locate the position of the space you want to remove. For example, to find the first space in cell A1, use: =FIND(" ",A1)
  3. Use the REPLACE function to replace the space with an empty string. For example, to replace the first space in cell A1 with nothing, use: =REPLACE(A1,FIND(" ",A1),1,"")
  4. Copy the formula down to the rest of the cells in your range.

Remember to adjust the cell references and the text you are searching for based on your specific data.

Related Articles