How to Use the TRIM function to delete spaces in Excel
Today, we are presented with a tricky problem that we need to correct. In Column A, we have text that has spaces at both the left and right side of the text. This is a problem as we will be using this data for evaluation in other formulas. To correct this, we will be using the TRIM function to remove all spaces from a text string except for the single spaces between words. Here is how we’ll achieve this:
How to Delete spaces from the left and right of text:
- In cells A1:A5, type your text with spaces at the beginning and at the end.
- Select cells B1:B5 and type the following formula: =TRIM(A1).
- Press CTRL+Enter.
This tip should work in Excel 97, 2000, 2003 and 2007. You should now be set!