Go Back

How to Remove Leading and Trailing Spaces from Text

We can remove unwanted spaces to the right and left of a text with the TRIM Function. The steps below will walk through the process

Figure 1: Result of the Removed Leading and Trailing Spaces from the Text

Syntax

=TRIM(TEXT)

Formula

=TRIM(A4)

Setting up the Data

  • We will input the TEXT in Column A as shown in FIGURE 2

 

  • The output will be displayed in the empty cells of Column B

 

Figure 2: Data on Round to the Nearest 1000

Remove Leading and Trailing Spaces from Text

  • We will click on Cell B4 and input the formula below

=TRIM(A4)

Figure 3: How to Remove Leading and Trailing Spaces from Text

  • We will press the enter key and drag down with the fill handle to copy the formula to the rest of the cells from B5 to B8

Figure 4: Result of the Removed Leading and Trailing Spaces from the Text

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

Simple formula to remove spaces and add text
Solved by G. J. in 17 mins
I'm trying to create a formula that combines cells, remove spaces, and adds text.
Solved by S. Q. in 22 mins
Trying to create a quick formula to remove spaces and add text
Solved by K. D. in 29 mins

Leave a Comment

avatar