Applies ToExcel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web

The TRIM function removes all leading and trailing spaces except single spaces between words. To remove non-printing characters and other items, see Top ten ways to clean your data.

Syntax: =TRIM([string or cell])

Example 1: =TRIM(" Sales report ") removes spaces at the beginning and end of "Sales report". 

Example 2: =TRIM(C3) removes spaced at beginning and end of contents of cell C3. 

For more info, see TRIM function.

The TRIM function removes all leading and trailing spaces except single spaces between words. To remove non-printing characters and other items, see Top ten ways to clean your data.

Syntax: =TRIM([string or cell])

Example 1: =TRIM(" Sales report ") removes spaces at the beginning and end of "Sales report". 

Example 2: =TRIM(C3) removes spaced at beginning and end of contents of cell C3. 

For more info, see TRIM function.

The TRIM function removes all leading and trailing spaces except single spaces between words. To remove non-printing characters and other items, see Top ten ways to clean your data.

Syntax: =TRIM([string or cell])

Example 1: =TRIM(" Sales report ") removes spaces at the beginning and end of "Sales report". 

Example 2: =TRIM(C3) removes spaced at beginning and end of contents of cell C3. 

For more info, see TRIM function.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.