TRIM(text)
=TRIM(A2) // removes extra spaces from A2
This example shows how the TRIM function can be used to remove extra spaces from a cell. In this example, the TRIM function is used on cell A2. This will remove any extra spaces from the cell, leaving only the original text.
=LEN(A16)-LEN(TRIM(A16)) // returns the number of extra spaces in A16
This example shows how the LEN and TRIM functions can be used to find the number of extra spaces in a cell. In this example, the LEN function is used on cell A16, and then the LEN function is used on A16 after applying the TRIM function. By subtracting the results, this will return the number of extra spaces in cell A16.
The TRIM function is a method for cleaning up data in a worksheet. It removes extra spaces from data, including irregular spacing.