Excel TRIM function

Summary

The Excel TRIM function removes extra spaces from the beginning and end of a text string, as well as removes double spaces between characters.

Function

=TRIM(text)

Arguments (inputs)

text = the text string to be trimmed, can be a cell reference or value

Return value

The TRIM function returns a text string that removes the extra spaces from the beginning and end of a text string, as well as removes double spaces between characters.

Example

Excel TRIM function example

In the example above the TRIM function removes the extra spaces from the beginning, end, and in between characters from the customer name (C6). C6 contains the text ” Claire Gute “, with two extra spaces at the beginning, and three extra spaces at the end.

=TRIM(C6)

The result returned in cell J6 is “Claire Gute” with no extra spaces. In the example you can see that the original text string in cell C6 had 16 characters (in cell I6), and now the result in cell J6 only has 11 characters (in cell K6).