If you are in the habit of copying content from other spreadsheet to your Excel database, you might often be faced with the situation where the copied content display additional spaces either the beginning or end of a string. You may also find extra spaces within a string. In this Excel 2010 tutorial, you will learn how to remove extra spaces in cells using the TRIM function.
How to Remove Extra Spaces in Cells
1. Place the cursor in the cell where you want the result to appear.
2. Type =TRIM(Cell Reference) and press Enter.
The result is that text will now remove all leading and trailing spaces, as well as extra spaces in the middle of a string.
There may be times when the TRIM function does not work. For instance, when data is copied from a HTM page, the spaces in the cells are nonbreaking spaces with a decimal character code of 160 rather than a ASCII space decimal character code of 32. In such cases, you will have to use the formula =TRIM(SUBSTITUTE(Cell Reference,CHAR(160),CHAR(32))).
Now you can quickly remove those unwanted spaces in a jiffy and focus on getting your job done.