TRIM
The TRIM formula is used to remove leading and trailing spaces from a cell. To use the TRIM formula, select the cell where you want the result to appear and enter “=TRIM(” followed by the cell you want to remove spaces from. For example, “=TRIM(A1)” would remove leading and trailing spaces from cell A1.
Example:
Remove leading and trailing spaces from cell A1: =TRIM(A1).