Go Back

Excel TRIM Function

We can use the Excel TRIM function to remove extra spaces from a text. This allows us to have only single spaces between words, with no space characters at the start or end of a text. This post provides an elaborate method of how to use the Excel TRIM function to removes the extra spaces.

Figure 1: Using TRIM function to remove extra spaces

General syntax of the formula

=TRIM (text)


  •         Text- refers to the text which we want to remove the extra spaces

How the formula works

  •         The TRIM function is fundamental when we have text that has extra spaces in between words.
  •         What this function does is to remove these extra spaces and return words without the extra spaces at the beginning or end of text.
  •         This function only removes the ASCII spaces character
  •         It cannot eliminate spaces from a Unicode text

In the example above, we want to remove all the unnecessary spaces from the text in column A. to do this, we shall need to have the result displayed in column B.

We specify our formula in cell B2 as “=TRIM (A2) and simply press Enter. This removes the extra spaces.

We then copy down the formula to “trim” the spaces from the text in the other cells.

Instant Connection to an Expert through our Excelchat Service

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

How can I convert =TRIM function to the numbers?
Solved by M. J. in 26 mins
trying to trim and concaternate some info
Solved by V. U. in 22 mins
I'm trying to adding text of multiple cells and trim the irrelevant parts.
Solved by D. Q. in 15 mins

Leave a Comment