Table of Contents
- Removing Spaces in Excel Cell
Removing Spaces in Excel Cell
Sometimes we have some excel data wherein texts or numbers contain spaces between them. In any point of time, we need the data extracted and without spaces. Excel has few tricks up its sleeve which does the work for us. In this topic, we will learn how to remove spaces in excel Cell.
We all have just come across some sorts of data which are either manually entered some spaces or maybe some data has spaces to separate texts or numbers. How do we filter out the data with spaces in excel? There are various methods to do so and are described below with examples.
Here we will discuss the top 5 methods to remove spaces in excel cell
- Using Trim Function
- Using Delimited in Text to Columns
- Using Fixed width in Text to Columns
- Using Find & Replace Option
- Using Substitute Function
#1 – How to Remove Space from text in Excel Using Trim Function?
We have the following data with us,
Cells in column A has texts which have spaces between them and we will remove the spaces from them in column B.
- In B1 Type =Trim.
As explained in the text Trim function removes all spaces from a text string except for single spaces between words.
- Select A1 cell.
- Click Enter and excel automatically remove the extra spaces.
- Drag and Copy the formula to cell B5.
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 also can remove spaces from a cell. Consider the following data,
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.
- Select Column A then, go to Data Tab click on Text to Columns.
- Select Delimited.
- Click on Next Space as a delimiter then Click on Finish.
Excel separated the texts from their spaces and placed them into the next column.
#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.
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.
- Select Fixed width then Click on next.
However, your cursor where the spaces are then, Click on Finish.
Now we have separated our data from the spaces using fixed width in the text to columns.
#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.
- Press CTRL + H and a dialog box appears for find and replace.
- Below in find what box press spacebar and in replace button to leave it a blank and click on replace all.
- Excel gives us a prompt that all the spaces are removed. Click ok to see the result.
- Each and every space in the cells have been removed.
#5 – How to Remove Space in Excel Using Substitute Function?
We can also use the substitute function to remove all the spaces in a cell. Let us consider the same data in Example 1 again.
- In Cell B1, type =substitute and go to Formulas tab Click on Insert Function Option to open the function dialog box.
- The text we want is from cell A1, so in text select A1.
- We want to remove extra spaces so in Old Text box type “ “, which means space.
- In the new text type “”, which means no spaces then, Click on Ok.
- Drag the formula to cell B5.
With Substitute function, we replaced spaces in the cells.
Explanation of Removing Spaces in Excel
When we import a 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 About Removing Spaces in Excel
There are few points to remember while removing spaces in excel.
- We need to think about which method to use in certain cases.
- Using text to column options will separate the data in another column.
- Removing spaces using find and replace option and substitute function can put up all the strings together.
You can download this Remove Extra Spaces from Excel Cell template here –Remove Spaces Excel Template
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 top 5 methods (Trim, Delimited, Fixed Width, Find and Replace and Substitute) along with practical examples and downloadable excel template. You may learn more about excel from the following articles –