The TRIM function in Excel removes leading and trailing spaces from data, leaving only one space if multiple spaces appear within. Therefore, the TRIM function is the most effective solution to remove unnecessary spaces in Excel.
How to Remove Spaces in Excel?
Guide to Removing Spaces in Excel
To remove unnecessary spaces, follow these steps:
- Select the data range to apply the TRIM function.
- Then input the formula: =TRIM(cell location to remove data). In the example, the cell location to remove data is A3.
- Press Enter to confirm the function.
- Apply the formula to cells below by clicking on the bottom right corner of the cell and dragging down, you will get results as shown in the image below:
To copy the data after editing with the TRIM function, first press Ctrl+C, or right-click and choose Copy as usual.
As shown in the image above, the section highlighted in red, you will notice that fundamentally the new data remains as the TRIM function and not as displayed. Therefore, you cannot press Ctrl+V in the usual copy manner.
When reaching the new data location, right-click and select Value in the Paste Options.
As shown in the result below, the function part has been removed, now you can use this new data instead of the old data.
This is a tutorial on how to remove spaces in Excel. In addition to Excel tips, you can also refer to articles on removing spaces and line breaks in Word on Mytour. Wish you success.