Remove Leading Spaces in Excel

How to Remove Leading Spaces in Excel Cell?

Often in excel, unwanted space characters take a considerable amount of time to clean and make the data perfect. One of the biggest problems with these unwanted leading spaces in excel cell is we cannot simply recognize there is a space in it. This adds to the misery.

#1 – Remove Unwanted Leading Spaces in Excel Cell Using TRIM Function

Lets start.

  1. Yes, you could argue that why don’t we replace the space with nothing. But the problem is all the necessary spaces are also will get replaced along with it. For example, look at the below sentence in a cell.

    Remove Space Example 1

    In the above sentence, we need one space character after each completed word to make the sentence proper. We have only one extra space after the word capital.

  2. In order to deal with these unwanted spaces problems, we have a built-in function called TRIM in Excel, which can remove all the unwanted spaces in excel cell.

    Trim Formula

  3. The syntax is very simple. We just need to select the required cell to be trimmed. The Trim function removes all the spaces except the single space after each word. Let’s apply the Trim formula in excel to remove all kinds of spaces in a cell.

    Remove Space Example 1-1

  4. This trim function removed the spaces between “Capital” and “is.”

    Remove Space Example 1-2

#2 – Remove Non-Breaking Leading Spaces in Excel Cell

It is very easy to remove normal leading spaces in the excel cell. In the case of non-breaking leading spaces, the Trim function goes wrong. Look at the below image.

Remove Space Example 2

Even after the Trim is applied, we don’t see the perfect sentence here. This is the problem with non-breaking leading spaces in an excel cell.

Non-Breaking Leading Spaces in Excel Cell usually comes when we download the data from a web which is made up of the character CHAR (160). In these cases, we need to use TRIM and SUBSTITUTE excel function together.

Firstly open the TRIM function.

Remove Space Example 2-1

Now apply the SUBSTITUTE function.

Remove Space Example 2-2

We need to select the text now, so select the A4 cell as the reference.

Remove Space Example 2-3

What is the old text we need to remove here? The old text is CHAR (160).

Remove Space Example 2-4

New text to be a substitute is nothing, so mention double quotes (“).

Remove Space Example 2-5

Close the bracket and hit the enter key. We would get an accurate sentence now.

Remove Space Example 2-6

This way, we can deal with breaking spaces in Excel Cell. If the TRIM function is not able to give to proper results, then use this technique.

#3 – Remove Double Spaces Using Excel FIND & REPLACE Method

We can remove double spaces in cells by using Excel find and replace method as well. Assume below is the data we have in excel.

Remove Space Example 3

Here we have a first name and last name together. After the first name, we have two spaces instead of one space. In these cases, instead of the TRIM function, we can also use find and replace methods.

Step 1: Select the required area’s double space to be removed.

Remove Space Example 3-1

Step 2: Now press CTRL + H.

Shortcut for Find & Replace

You will see below Find & Replace window.

Remove Space Example 3-2

Step 3: In the Find what: box, type two space character.

Remove Space Example 3-3

Step 4: Now, in the Replace with: type only one space character.

Remove Space Example 3-4

Step 5: Now click on Replace All.

Remove Space Example 3-5

Step 6: Now, excel will show you how many replacements it has made.

Remove Space Example 3-6

Step 7: It has removed all the double spaces in the excel cell and replaced it with a single space, and we have proper names now.

Remove Space Example 3-7

#4 – Remove All Leading Spaces Using Excel FIND & REPLACE Method

Assume you are working with numbers, and you have many spaces in between the number,s as shown in the below image.

Example 4

We have abnormal excel leading spaces in between, before, and after the numbers. In these cases, we need to remove all the spaces. So use the Find & Replace method.

  • Step 1: Select the data first.
Example 4-1
  • Step 2: Press Ctrl + H and type a single space in Find what: box.
Example 4-2
  • Step 3: Now, don’t enter anything in the replace what: box. Just click on replace all.
Example 4-3
  • Step 4: It will remove all the leading spaces in the excel cell, and we have numbers in order now.
Example 4-4

Things to Remember

  • If you are using the FIND & REPLACE method to Remove leading spaces in an excel cell, then it is important to select the range and do the operation.
  • If you are downloading the data from the web and you are encountering the same space problem, then you need to use the SUBSTITUTE function to remove CHAR (160) along with the TRIM function.
  • In order to remove non-printable characters, use the CLEAN Excel function.

Recommended Articles

This has been a guide to Remove Leading Spaces in Excel Cell. Here we discuss how to Remove Leading Spaces in Excel along with practical examples and a downloadable excel template. You may learn more about excel from the following articles –

  • 35+ Courses
  • 120+ Hours
  • Full Lifetime Access
  • Certificate of Completion