A step by step guide to remove spaces before and after text in Google Sheets
- Remove leading and trailing spaces by using the TRIM function. On a new cell, go to Insert -> Function -> Text -> TRIM. Select the cell that you want to trim, and press Enter
- To apply on the rest of the rows, you can copy by dragging the cell which you have inserted the function. (In this example, it is cell B1)
- To get the trimmed text, you will need to copy and paste only the values to a new cell. To copy, ‘Ctrl+C’. To paste only values, right click Paste Special -> Values Only (or ‘Ctrl+Shift+V’)