Sometimes during data entry, unnecessary spaces are introduced in front of the useful data. This can happen when a name is entered into a Web form, for example. It can also happen when data is drawn from another source, such as an older or different format spreadsheet. Fortunately, Microsoft's Excel spreadsheet software has a built-in function to remove these unnecessary spaces.
Locate the cell that contains the text from which you need to remove leading spaces. Note the column letter and row number.
Click in an empty cell.
Type "=Trim(LetterNumber)" without quotation marks, replacing "Letter" with the column letter and "Number" with the row number of the cell that contains the text. For example, to trim the leading spaces from column C, row 5, you would enter "=Trim(C5)" without quotation marks.
Tips & Warnings
- You can also remove outer spaces directly from text using the TRIM function by putting the text in the parentheses instead of the column letter and line number and surrounding it with quotation marks.
How to Replace Blanks With Zeroes in Excel
Typing "0" in each individual blank cell in Microsoft Excel would be a tedious process. Fortunately, Microsoft Excel has a built-in function...
How to Remove All White Spaces to the Right of a Word in Excel
If you receive a Microsoft Excel spreadsheet that contains text and notice that some of the fields contain extraneous spaces, you may...
How to Remove Blank Spaces in SQL
In the programming world, it's important that data entered by users be validated. Users commonly enter data through text boxes, list boxes...