# Remove Leading Spaces in Excel

Updated on January 2, 2024
Article byJeevan A Y
Edited byAshish Kumar Srivastav
Reviewed byDheeraj Vaidya, CFA, FRM

## How to Remove Leading Spaces in Excel Cell?

In Excel, unwanted space characters often take considerable time to clean and make the data perfect. One of the biggest problems with these unwanted leading spaces in Excel cells is that we cannot simply recognize a space in it. It adds to the misery.

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

Let us start.

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

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. To deal with these unwanted space problems, we have a built-in function called TRIM in Excel, which can remove all the unwanted spaces in the Excel cells.

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

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

–>> If you want to learn Excel and VBA professionally, then ​Excel VBA All in One Courses Bundle​ (35+ hours) is the perfect solution. Whether you’re a beginner or an experienced user, this bundle covers it all – from Basic Excel to Advanced Excel, Macros, Power Query, and VBA.

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

It is very easy to remove normal leading spaces in the Excel cell. However, the TRIM function goes wrong in the case of non-breaking leading spaces. For example, look at the below image.

Even after the TRIM function is applied, we do not see the perfect sentence here. It is a 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 made up of the character CHAR (160). Therefore, we must use TRIM and in these cases together.

Firstly, open the TRIM function.

Now, apply the SUBSTITUTE function.

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

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

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

Close the bracket and press the “Enter” key. We will get a proper sentence now.

This way, we can deal with breaking spaces in the Excel cell. If the TRIM function cannot give accurate results, use this technique.

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

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

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

Step 2: Now, press “CTRL + H.”

You will see below the “Find and Replace” window.

Step 3: Type two space characters in the “Find what:” box.

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

Step 5: Now, click on “Replace All.

Step 6: Excel will show you how many replacements it has made.

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

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

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

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

• Step 1: Select the data first.
• Step 2: Press “Ctrl + H” and type a single space in the “Find what:” box.
• Step 3: Do not insert anything in the “Replace what:” box. Just click on “Replace All.”
• Step 4: It will remove all the leading spaces in the Excel cell. We have numbers in order now.

### Things to Remember

• If the FIND and REPLACE method is used to remove leading spaces in an Excel cell, selecting the range and performing the operation is important.
• If downloading the data from the web and encountering the same space problem, we must use the SUBSTITUTE function to remove CHAR (160) along with the TRIM function.
• To remove non-printable characters, we must use the .