WallStreetMojo

WallStreetMojo

WallStreetMojo

MENUMENU
  • Free Tutorials
  • Certification Courses
  • Excel VBA All in One Bundle
  • Login
Home » Excel, VBA & Power BI » Excel Tutorials » Remove Space in Excel

Remove Space in Excel

Top 5 Methods to Filter Data with Spaces in Excel

  1. Using Trim Function
  2. Using Delimited in Text to Columns
  3. Using Fixed width in Text to Columns
  4. Using Find & Replace Option
  5. Using Substitute Function

Let us discuss each of the methods in detail, along with an example.

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

#1 – How to Remove Space from the text in Excel Using Trim Function?

We have the following data with us,

Removing space Example 1

Cells in column A have texts which have spaces between them, and we will remove the spaces from them in column B.

  • In B1 Type =Trim.

Removing space Example 1-1

As explained in the text, the Trim function removes all spaces from a text string except for single spaces between words.

  • Select the A1 cell.

Removing space Example 1-2

  • Click Enter, and excel automatically remove the extra spaces.

Removing space Example 1-3

  • Drag and Copy the formula to cell B5.

Removing space Example 1-4

Trim Function removed the extra spaces except for the space between the texts itself.

#2 – How to Remove Space Using Delimited in Text To Columns?

Text to columns in excel also can remove spaces from a cell. Consider the following data,

Removing space Example 2

Where trim function did not remove the spaces between the texts but with text to columns, we can remove the extra spaces between the texts and numbers in excel also.

Popular Course in this category
Sale
All in One Excel VBA Bundle (35 Courses with Projects)
4.9 (1,353 ratings)
35+ Courses | 120+ Hours | Full Lifetime Access | Certificate of Completion
View Course
  • Select Column A then, go to Data Tab, click on Text to Columns.

Removing space Example 2-1

  • Select Delimited.

Removing space Example 2-2

  • Click on Next Space as a delimiter, then Click on Finish.

Removing space Example 2-3

Excel separated the texts from their spaces and placed them into the next column.

Removing space Example 2-4

#3 – How to Remove Space in Excel Using Fixed Width in Text to Columns Option?

We can also use fixed width in a text to columns option to remove extra spaces from text and numbers in excel. However, our data needs to be in an exact number of characters before the space so that only spaces can be removed. Consider the following data.

Removing space Example 3

We have some random text with random numbers with spaces separating them. We need to remove the spaces and have the numbers in another column.

  • Select Column A, then, in Data Tab, Select Text to columns.

Removing space Example 3-1

  • Select Fixed width, then Click on next.

Removing space Example 3-2

However, your cursor where the spaces are then, Click on Finish.

Removing space Example 3-3

Now we have separated our data from the spaces using fixed width in the text to columns.

Removing space Example 3-4

#4 – How to Remove Space Using Find & Replace Option?

Find and replace option also can be used to remove spaces from text and numbers in excel cell. We will consider the same data used in example #1.

Find & Replace - Example 4

  • Press CTRL + H, and a dialog box appears to find and replace.

Find & Replace - Example 4-1

  • Below in find what box press spacebar and in replace button to leave it a blank and click on replace all.

Find & Replace - Example 4-2

  • Excel gives us a prompt that all the spaces are removed. Click ok to see the result.

Find & Replace - Example 4-3

  • Each and every space in the cells have been removed.

Find & Replace - Example 4-4

#5 – How to Remove Space in Excel Using Substitute Function?

We can also use the substitute function in excel to remove all the spaces in a cell. Let us consider the same data in Example 1 again.

Substitute Function- Example 5

  • In Cell B1, type =substitute and go to the Formulas tab. Click on Insert Function Option in excel to open the function dialog box.

Substitute Function - Example 5-1

  • The text we want is from cell A1, so in text, select A1.

Substitute Function - Example 5-2

  • We want to remove extra spaces, so in the Old Text box, type “, “which means space.

Substitute Function - Example 5-3

  • In the new text type “, which means no spaces then, Click on Ok.

Substitute Function - Example 5-4

Substitute Function - Example 5-5

  • Drag the formula to cell B5.

Substitute Function - Example 5-6

With the Substitute function, we replaced spaces in the cells.

Explanation of Removing Spaces in Excel

When we import data or copy and paste the data in excel from an external source, we also might end up getting extra spaces apart from our important Data.

Also, by having extra spaces, data can look disorderly and can be difficult to use.

To overcome this challenge, we remove extra spaces from our data cell so that it can be more presentable and readable.

Things to Remember

There are few points to remember while removing spaces in excel.

  1. We need to think about which method to use in certain cases.
  2. Using text to column options will separate the data in another column.
  3. Removing spaces using find and replace in excel and substitute function can put up all the strings together.

Recommended Articles

This has been a guide to Removing Spaces in Excel Cell. Here we discuss how to remove spaces from text and numbers in excel using the top 5 methods (Trim,  Delimited, Fixed Width, Find and Replace and Substitute) along with practical examples and a downloadable excel template. You may learn more about excel from the following articles –

  • Randomize List Excel
  • Hiding an Excel Column
  • Hide Formula in Excel
  • Copy Sheet in Excel
1 Shares
Share
Tweet
Share
All in One Excel VBA Bundle (35 Courses with Projects)
  • 35+ Courses
  • 120+ Hours
  • Full Lifetime Access
  • Certificate of Completion
LEARN MORE >>
Primary Sidebar
Footer
COMPANY
About
Reviews
Contact
Privacy
Terms of Service
RESOURCES
Blog
Free Courses
Free Tutorials
Investment Banking Tutorials
Financial Modeling Tutorials
Excel Tutorials
Accounting Tutorials
Financial Statement Analysis
COURSES
All Courses
Financial Analyst All in One Course
Investment Banking Course
Financial Modeling Course
Private Equity Course
Venture Capital Course
Excel All in One Course

Copyright © 2021. CFA Institute Does Not Endorse, Promote, Or Warrant The Accuracy Or Quality Of WallStreetMojo. CFA® And Chartered Financial Analyst® Are Registered Trademarks Owned By CFA Institute.
Return to top

WallStreetMojo

Free Excel Course

Excel functions, Formula, Charts, Formatting creating excel dashboard & others

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

Book Your One Instructor : One Learner Free Class
Let’s Get Started
Please select the batch
Saturday - Sunday 9 am IST to 5 pm IST
Saturday - Sunday 9 am IST to 5 pm IST

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

WallStreetMojo

Free Excel Course

Excel functions, Formula, Charts, Formatting creating excel dashboard & others

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

Login

Forgot Password?

WallStreetMojo

Download Remove Spaces Excel Template

New Year Offer - All in One Excel VBA Bundle (35 Courses with Projects) View More