How to remove extra spaces in a cell in Microsoft Excel

Updated: 04/30/2020 by Computer Hope
Microsoft Excel

Occasionally, you may find one or more extra spaces in a cell in Microsoft Excel. Below are steps for removing the extra, unnecessary spaces using two methods.

Steps for removing spaces in cells containing only one word

  1. Open the Microsoft Excel workbook containing the data you must edit.
  2. Select the cells that contain extra spaces.
  3. On the keyboard, press Ctrl+H to bring up the Find and Replace tool.
  4. Click in the Find what text field, and press spacebar once. This action places a space in the text field.
  5. Leave the Replace with text field empty.
  6. Click Replace All.
  7. The cells now contain no spaces.

Steps for removing extra spaces with the Excel trim function

Note

The trim function removes extra, unnecessary spaces with multiple words in a cell without removing the necessary spaces.

Tip

The following steps are also outlined in the video below the steps.

  1. Open the Microsoft Excel workbook containing the data you must edit.
  2. Add a column to the right of the column containing cells with spaces. In the top cell of the new column, enter a label for the column, like "Trim" or similar. This column is deleted in a later step.
  1. In the trim column, type =trim in the first cell next to the cell of data from which you must remove spaces. In the auto-suggest terms that pop up when you start typing the formula, double click the =trim option. This action enters the formula in the blank cell and appears as =TRIM(.
  2. Click the cell containing the data with the extra space, eg., cell A2. This action enters the cell data in the trim cell. For example, the formula would look like =TRIM(A2.
  3. Enter a right parenthesis ) to the end of the formula in the trim cell to complete the formula.
  4. Press Enter and the data from cell A2 is displayed without the extra spaces.
  5. Use the Excel AutoFill feature to copy and paste the formula to any other cells containing extra spaces.
  6. Select and copy the cells in the trim column.
  7. Right-click the first cell where the data needs to be pasted. In the pop-up menu, under Paste Options, click the Paste values icon, which looks like a clipboard with the numbers "123" on it. This action pastes the values from the trim column into the original data column, with extra spaces removed.
  8. As a clean-up step, select the entire trim column, right-click and select Delete in the pop-up menu to remove the column.