How to remove extra spaces in a cell in Microsoft Excel
Updated: 04/30/2020 by Computer Hope
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
- Open the Microsoft Excel workbook containing the data you must edit.
- Select the cells that contain extra spaces.
- On the keyboard, press Ctrl+H to bring up the Find and Replace tool.
- Click in the Find what text field, and press spacebar once. This action places a space in the text field.
- Leave the Replace with text field empty.
- Click Replace All.
- 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.
- Open the Microsoft Excel workbook containing the data you must edit.
- 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.
- 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(.
- 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.
- Enter a right parenthesis ) to the end of the formula in the trim cell to complete the formula.
- Press Enter and the data from cell A2 is displayed without the extra spaces.
- Use the Excel AutoFill feature to copy and paste the formula to any other cells containing extra spaces.
- Select and copy the cells in the trim column.
- Right-click the first cell where the data needs to be pasted. In the pop-up menu, under Paste Options, click the 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.
- As a clean-up step, select the entire trim column, right-click and select Delete in the pop-up menu to remove the column.