EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • All Courses
    • All Specializations
  • Blog
  • Enterprise
  • Free Courses
  • All Courses
  • All Specializations
  • Log in
  • Sign Up
Home Excel Excel Resources Excel Tips Excel Remove Spaces
 

Excel Remove Spaces

Pradeep S
Article byPradeep S
Madhuri Thakur
Reviewed byMadhuri Thakur

Remove Spaces in Excel

Excel Remove Spaces (Table of Contents)
  • Introduction to Remove Spaces in Excel
  • Different Types Of Spaces
  • How to Remove Extra Spaces in Excel?

Introduction to Remove Spaces in Excel

There are multiple ways to remove spaces in Excel. The first way we can remove the extra unwanted spaces is with the help of the FIND and REPLACE options (Ctrl + H). We must put a space and replace that with a Blank (Nothing kept). This removes the spaces anywhere from the selected cells. Alternatively, we can remove the spaces using a TRIM function. This removes the spaces at the start and end of the selected cell content. And we can also use the SUBSTITUTE function, where we can substitute space with blank to remove spaces completely.

 

 

Different Types of Spaces

  • It may contain extra spaces before text strings in cells, called Leading spaces.

Leading Space

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

  • It may contain extra spaces after text strings in cells, called Trailing spaces.

Trailing space

  • Datasets may contain extra in-between spaces, i.e.additional spaces in between text.

Extra in-between space

  • Datasets may also contain Line breaks with extra space.

Line breaks with extra space

We can get rid of these types of spaces quickly & easily with the below-mentioned options:

  • FIND AND REPLACE
  • TRIM Function
  • SUBSTITUTE Function
  • CLEAN and TRIM function to Remove Extra Space of Line Break in Excel

TRIM Function

TRIM function is a prebuilt integrated function categorized under Text functions. It Removes all extra spaces from text except a single space between words in Excel.

The syntax or formula for the TRIM function in Excel is:

TRIM Formula

The trim function in Excel has only one compulsory argument or parameter, i.e., text.

  • Text: It is cell content from where you need to remove extra spaces in Excel.

The TRIM function removes the text’s ASCII space character (32).

How to Remove Extra Spaces in Excel?

Removing extra spaces in Excel is very simple and easy. Let’s understand the working of removing extra spaces in Excel with the help of some examples.

You can download this Remove Spaces Excel Template here – Remove Spaces Excel Template

Example #1 – Remove Excel Spaces with the help of Find and Replace

In the below-mentioned example, I have a dataset in column D that contains all three types of extra spaces, i.e., Leading spaces, Trailing spaces & Extra in-between spaces.

I have done several character counts for the column D datasets for reference. With the help of the LEN function in column E., I have taken this raw data to another new column (column H) to apply the Find and Replace task.

Example 1

Now, I have to select the cell range where the Find and Replace parameter needs to be applied to remove extra spaces in Excel.

Remove Spaces Example 1-2

To activate the find and replace option, press the shortcut key Ctrl + H, find and replace window appears.

Remove Spaces Example 1-3

In Find what: input bar, insert a blank space with the help of the space bar once, and in Replace with no need to input anything, it should remain blank. Click on the Replace All button.

Remove Spaces Example 1-4

It replaces all the blank spaces in the cell.

Remove Spaces Example 1-5

You can find a difference in character count between both datasets. Where Find and Replace, remove all the blank spaces. In extra in-between spaces content also, it has removed all the blank spaces without retaining a single space between words (This can be rectified with the help of the TRIM function).

Result of Example 1

Note: This method is only used when you want to remove a leading & trailing type of extra spaces from selected cells or completely remove all the spaces in the data range from Excel.

Example #2 – Remove Excel Spaces with the Help of the TRIM Function

In the below-mentioned example, I have a dataset in column D that contains all three types of extra spaces, i.e., leading spaces, trailing spaces & extra in-between spaces.

For reference, I have done several characters counts for the column D datasets. With the help of the LEN function in column E., I have taken this raw data to another new column (column G) to apply the TRIM Function. The Excel TRIM function removes all spaces from text except a single space between words.

Example 2

Now, In cell H4, let’s apply a TRIM function.

Remove Spaces Example 2-2

In the Formulas tab, click the Text drop-down menu in the Functions section and select TRIM.

Remove Spaces Example 2-3

Now the function argument dialog box appears; click on cell G4, which contains the text where I would like to remove spaces to complete the function, then click OK.

Remove Spaces Example 2-4

Now, you can observe in cell H4, where the trim function removes the leading space in that cell.

Remove Spaces Example 2-5

Similarly, a TRIM function is applied to other ranges by selecting the cell H4, dragging it to H9, and clicking Ctrl+D to apply it to the rest of the cells.

Remove Spaces Example 2-6

You can find a difference in character count between both datasets where the TRIM Function removes all spaces before and after the text in the cell (i.e., G4, G5, G6 & G7) & consecutive spaces in the middle of a string in the cell G8 & G9.

Result of Example 2

Example #3 – Remove Excel Spaces with the help of the SUBSTITUTE Function

It will remove all the extra Excel spaces, including single spaces between words or numbers.

In the below-mentioned example, I have a dataset in column D that contains all three types of extra spaces, i.e., leading spaces, trailing spaces & extra in-between spaces.

For reference, I have done several characters counts for the column D datasets. With the help of the LEN function in column E., I have taken this raw data to another new column (column G) to apply the SUBSTITUTE Function.

Example 3

Now, In cell H4, let’s apply the SUBSTITUTE Function.

Remove Spaces Example 3-2

In the Formulas tab, click the Text drop-down menu in the Functions section and select SUBSTITUTE.

Remove Spaces Example 3-3

Now the function argument dialog box appears:

  • Text Click on the first cell in the column that you need to be changed.
  • In the Old_text, I need to enter the character that needs to be replaced; it should be entered between double quotes. i.e., for removal of spaces, it will be” “.
  • Here, in the New text, I don’t want to replace anything; therefore, it is typed as “.

Remove Spaces Example 3-4

Now, you can observe in cell H4, where the Substitute function removes leading space in that cell.

Remove Spaces Example 3-5

SUBSTITUTE Function is applied to other ranges by selecting the cell H4 and dragging it to H9, and clicking Ctrl+D so that it is applied to other cells.

Remove Spaces Example 3-6

You can find a difference in character count between both datasets. Substitute Function removes all the blank spaces; in extra in-between spaces content, it has removed them without retaining a single space between words.

Result of Example 3

Things to Remember about Excel Remove Spaces

  • Since the extra space is also a character, therefore in ASCII (American Standard Code for Information Interchange) encoding, it has code number 32.
  • Sometimes, the data appears as line breaks which may contain extra spaces between words; To remove those extra spaces, we can combine Excel TRIM and CLEAN functions to Remove the Extra Space of Line breaks.

Recommended Articles

This has been a guide to Remove Spaces in Excel. Here we discuss how to Remove Extra Spaces in Excel, practical examples, and a downloadable Excel template. You can also go through our other suggested articles –

  1. Address Excel Function
  2. SUBSTITUTE Function in Excel
  3. LEN Function in Excel
  4. SEARCH Formula in Excel
Primary Sidebar
Footer
Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA
Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

Download Remove Spaces Excel Template

EDUCBA Login

Forgot Password?

EDUCBA

Download Remove Spaces Excel Template

EDUCBA

डाउनलोड Remove Spaces Excel Template

🚀 Limited Time Offer! - 🎁 ENROLL NOW