Question: how to trim blank space in excel

How to remove blank spaces in Excel - leading, trailing, non-breaking How to remove spaces in Excel - leading, trailing, non-breaking
How to remove spaces in Excel - leading, trailing, non-breaking
How to remove blank spaces in Excel - leading, trailing, between words
=TRIM (A2)
How to delete line breaks and nonprinting characters
=TRIM (CLEAN (A2))
How to remove non-breaking spaces in Excel
=TRIM (SUBSTITUTE (A2, CHAR (160), " "))
=TRIM (CLEAN ( (SUBSTITUTE (A2,CHAR (160)," "))))
How to delete a specific non-printing character
=TRIM (SUBSTITUTE (SUBSTITUTE (A2, CHAR (127), " "), CHAR (160), " ")))
How to remove all spaces in Excel
=SUBSTITUTE (A2, CHAR (32), "")
=SUBSTITUTE (A2," ","")
How to count spaces in Excel
=LEN (A2)-LEN (SUBSTITUTE (A2," ",""))
=LEN (A2)-LEN (TRIM (A2))
Formula-free way to remove spaces and clean data
You may also be interested in
 There are several ways to remove spaces from string, and this tutorial will help you choose the technique best suited for your particular task and the data type you are working with. Remove spaces in Excel (leading, trailing, extra spaces between words)
Delete line breaks and non-printing characters
Remove non-breaking spaces ( )
Delete a specific non-printing character
How to remove all spaces in Excel
How to count spaces in Excel
Text Toolkit - quick way to trim spaces and clean data
How to remove blank spaces in Excel - leading, trailing, between words
If your data set contains superfluous spaces, the Excel TRIM function can help you delete them all in one go - leading, trailing and multiple in-between spaces, except for a single space character between words. A regular TRIM formula is as simple as this: =TRIM (A2)
Where A2 is the cell you want to delete spaces from. As shown in the following screenshot, the Excel TRIM formula successfully eliminated all spaces before and after the text as well as consecutive spaces in the middle of a string. And now, you only need to replace values in the original column with trimmed values. The easiest way to do this is using Paste Special > Values, the detailed instructions can be found here: How to copy values in Excel. Additionally, you can use the Excel TRIM function to remove leading spaces only, keeping all spaces in the middle of a text string intact. The formula example is here:

How to remove blank spaces in Excel - leading, trailing, non-breaking

How to remove spaces in Excel - leading, trailing, non-breaking
How to remove spaces in Excel - leading, trailing, non-breaking
How to remove blank spaces in Excel - leading, trailing, between words
=TRIM (A2)
How to delete line breaks and nonprinting characters
=TRIM (CLEAN (A2))
How to remove non-breaking spaces in Excel
=TRIM (SUBSTITUTE (A2, CHAR (160), " "))
=TRIM (CLEAN ( (SUBSTITUTE (A2,CHAR (160)," "))))
How to delete a specific non-printing character
=TRIM (SUBSTITUTE (SUBSTITUTE (A2, CHAR (127), " "), CHAR (160), " ")))
How to remove all spaces in Excel
=SUBSTITUTE (A2, CHAR (32), "")
=SUBSTITUTE (A2," ","")
How to count spaces in Excel
=LEN (A2)-LEN (SUBSTITUTE (A2," ",""))
=LEN (A2)-LEN (TRIM (A2))
Formula-free way to remove spaces and clean data
You may also be interested in

Remove extra spaces in Excel 2016 - 2007 with Ultimate Suite Remove extra spaces in Excel
Remove extra spaces in Excel
Before you start
How to trim spaces in the range
 Remove extra spaces in Excel 2016 - 2007 with Ultimate Suite
Remove extra spaces in Excel
If extra spaces in your Excel worksheet don't let process your data correctly, use text tools from Ultimate Suite for Excel. It will help you remove leading and trailing spaces or get rid of excess blanks between words. Here you will learn how to remove spaces in Excel 2016 - 2007. Before you start
How to trim spaces in the range
Related links
Before you start
We care about your data. The add-in will back up your file if you select the corresponding option. How to trim spaces in the range
To run the needed tool, click the Trim Spaces icon in the Text group on the Ablebits Data tab: Then simply pick the needed options: Select the range where you want to remove extra spaces in your Excel worksheet. If you want to highlight the whole table quickly, click the Expand selection icon. Choose the option or a combination of options that suits you best:

Remove extra spaces in Excel 2016 - 2007 with Ultimate Suite

Remove extra spaces in Excel
Remove extra spaces in Excel
Before you start
How to trim spaces in the range

Remove extra spaces in Excel 2016 - 2007 with Ultimate Suite
Remove extra spaces in Excel
If extra spaces in your Excel worksheet don't let process your data correctly, use text tools from Ultimate Suite for Excel. It will help you remove leading and trailing spaces or get rid of excess blanks between words. Here you will learn how to remove spaces in Excel 2016 - 2007. Before you start
How to trim spaces in the range
Related links
Before you start
We care about your data. The add-in will back up your file if you select the corresponding option. How to trim spaces in the range
To run the needed tool, click the Trim Spaces icon in the Text group on the Ablebits Data tab: Then simply pick the needed options: Select the range where you want to remove extra spaces in your Excel worksheet. If you want to highlight the whole table quickly, click the Expand selection icon. Choose the option or a combination of options that suits you best:

How to remove blank spaces in Excel - leading, trailing, non-breaking How to remove spaces in Excel - leading, trailing, non-breaking
How to remove spaces in Excel - leading, trailing, non-breaking
How to remove blank spaces in Excel - leading, trailing, between words
=TRIM (A2)
How to delete line breaks and nonprinting characters
=TRIM (CLEAN (A2))
How to remove non-breaking spaces in Excel
=TRIM (SUBSTITUTE (A2, CHAR (160), " "))
=TRIM (CLEAN ( (SUBSTITUTE (A2,CHAR (160)," "))))
How to delete a specific non-printing character
=TRIM (SUBSTITUTE (SUBSTITUTE (A2, CHAR (127), " "), CHAR (160), " ")))
How to remove all spaces in Excel
=SUBSTITUTE (A2, CHAR (32), "")
=SUBSTITUTE (A2," ","")
How to count spaces in Excel
=LEN (A2)-LEN (SUBSTITUTE (A2," ",""))
=LEN (A2)-LEN (TRIM (A2))
Formula-free way to remove spaces and clean data
You may also be interested in
 Of course, learning a handful of formulas is a good exercise to sharpen your skills, but it might be time-consuming. Excel users who value their time and appreciate convenience can take advantage of the Text Tools included with our Ultimate Suite for Excel. One of these handy tools allows removing spaces and non-printing characters in a button click. Once installed, Ultimate Suite adds several useful buttons to your Excel ribbon such as Trim Spaces, Remove Characters, Convert Text, Clear Formatting, and a few more. Whenever you want to remove blank spaces in your Excel sheets, perform these 4 quick steps: Select the cells (range, entire column or row) where you want to delete extra spaces. Click the Trim Spaces button on the Ablebits Data tab. Choose one or several options: Remove leading and trailing spaces
Trim extra spaces between words to one
Delete non-breaking spaces ( )
Click the Trim button. Done!

Of course, learning a handful of formulas is a good exercise to sharpen your skills, but it might be time-consuming. Excel users who value their time and appreciate convenience can take advantage of the Text Tools included with our Ultimate Suite for Excel. One of these handy tools allows removing spaces and non-printing characters in a button click. Once installed, Ultimate Suite adds several useful buttons to your Excel ribbon such as Trim Spaces, Remove Characters, Convert Text, Clear Formatting, and a few more. Whenever you want to remove blank spaces in your Excel sheets, perform these 4 quick steps: Select the cells (range, entire column or row) where you want to delete extra spaces. Click the Trim Spaces button on the Ablebits Data tab. Choose one or several options: Remove leading and trailing spaces
Trim extra spaces between words to one
Delete non-breaking spaces ( )
Click the Trim button. Done!

Remove extra spaces in Excel 2016 - 2007 with Ultimate Suite Remove extra spaces in Excel
Remove extra spaces in Excel
Before you start
How to trim spaces in the range
 How to trim spaces in the range
To run the needed tool, click the Trim Spaces icon in the Text group on the Ablebits Data tab: Then simply pick the needed options: Select the range where you want to remove extra spaces in your Excel worksheet. If you want to highlight the whole table quickly, click the Expand selection icon. Choose the option or a combination of options that suits you best: If you pick Trim leading/trailing spaces, the spaces before and after cell values will be deleted. By ticking Trim spaces between words to 1, you'll have extra spaces between words within a cell removed. The Trim ' ' option means that non-breaking spaces that look like   in your worksheet will be deleted from the selected range. Tip. You can run any of these options right away by clicking the down arrow below the add-in's icon and picking the necessary option from the drop-down menu:

How to trim spaces in the range
To run the needed tool, click the Trim Spaces icon in the Text group on the Ablebits Data tab: Then simply pick the needed options: Select the range where you want to remove extra spaces in your Excel worksheet. If you want to highlight the whole table quickly, click the Expand selection icon. Choose the option or a combination of options that suits you best: If you pick Trim leading/trailing spaces, the spaces before and after cell values will be deleted. By ticking Trim spaces between words to 1, you'll have extra spaces between words within a cell removed. The Trim ' ' option means that non-breaking spaces that look like   in your worksheet will be deleted from the selected range. Tip. You can run any of these options right away by clicking the down arrow below the add-in's icon and picking the necessary option from the drop-down menu:

How to remove blank spaces in Excel - leading, trailing, non-breaking How to remove spaces in Excel - leading, trailing, non-breaking
How to remove spaces in Excel - leading, trailing, non-breaking
How to remove blank spaces in Excel - leading, trailing, between words
=TRIM (A2)
How to delete line breaks and nonprinting characters
=TRIM (CLEAN (A2))
How to remove non-breaking spaces in Excel
=TRIM (SUBSTITUTE (A2, CHAR (160), " "))
=TRIM (CLEAN ( (SUBSTITUTE (A2,CHAR (160)," "))))
How to delete a specific non-printing character
=TRIM (SUBSTITUTE (SUBSTITUTE (A2, CHAR (127), " "), CHAR (160), " ")))
How to remove all spaces in Excel
=SUBSTITUTE (A2, CHAR (32), "")
=SUBSTITUTE (A2," ","")
How to count spaces in Excel
=LEN (A2)-LEN (SUBSTITUTE (A2," ",""))
=LEN (A2)-LEN (TRIM (A2))
Formula-free way to remove spaces and clean data
You may also be interested in
 But there is no way to spot trailing spaces, those that keep out of sight at the end of cells. It wouldn't be much of a problem if extra spaces were just lying around, but they mess up your formulas. The point is that two cells containing the same text with and without spaces, even if it's as little as a single space character, are deemed different values. So, you may be racking your brain trying to figure out why an obviously correct formula cannot match two seemingly identical entries. Now that you are fully aware of the problem, it's time to work out a solution. There are several ways to remove spaces from string, and this tutorial will help you choose the technique best suited for your particular task and the data type you are working with. Remove spaces in Excel (leading, trailing, extra spaces between words)
Delete line breaks and non-printing characters
Remove non-breaking spaces ( )
Delete a specific non-printing character
How to remove all spaces in Excel
How to count spaces in Excel
Text Toolkit - quick way to trim spaces and clean data
How to remove blank spaces in Excel - leading, trailing, between words
If your data set contains superfluous spaces, the Excel TRIM function can help you delete them all in one go - leading, trailing and multiple in-between spaces, except for a single space character between words. A regular TRIM formula is as simple as this: =TRIM (A2)
Where A2 is the cell you want to delete spaces from. As shown in the following screenshot, the Excel TRIM formula successfully eliminated all spaces before and after the text as well as consecutive spaces in the middle of a string.

3 ways to remove spaces between words / numbers in Excel cells 3 ways to remove spaces between words / numbers in Excel cells
3 ways to remove spaces between words / numbers in Excel cells
Trim blanks between words to 1, remove trailing / leading spaces
Use the Trim formula to remove extra spaces
Using Find & Replace to remove extra spaces between words
3 clicks to neat data with Trim Spaces tool
Remove all spaces between numbers
Using formula to remove all spaces
Video: how to remove spaces in Excel
You may also be interested in
 Leading and trailing spaces will also be trimmed to 1, but will not be removed. Select one or several columns with the data to delete spaces between words. Press Ctrl + H to get the " Find and Replace " dialog box. Press the Space bar twice in the Find What field and once in Replace With
Click on the " Replace all " button, and then press Ok to close Excel confirmation dialog. Repeat step 4 until you see the message "We couldn't find anything to replace." :) 3 clicks to neat data with Trim Spaces tool
If you often import data to Excel from external sources and spend much time polishing up your tables, check out our Text tools for Excel. The Trim Spaces add-in will clean data imported from the web or any other external source. It removes leading and trailing spaces, excess blanks between words, non-breaking spaces, line breaks, non-printing symbols and other unwanted characters. Also, there is an option to convert words to UPPER, lower or Proper Case. And if you need to change text numbers back to the number format and delete apostrophes, this will not be a problem either.

3 ways to remove spaces between words / numbers in Excel cells

3 ways to remove spaces between words / numbers in Excel cells
3 ways to remove spaces between words / numbers in Excel cells
Trim blanks between words to 1, remove trailing / leading spaces
Use the Trim formula to remove extra spaces
Using Find & Replace to remove extra spaces between words
3 clicks to neat data with Trim Spaces tool
Remove all spaces between numbers
Using formula to remove all spaces
Video: how to remove spaces in Excel
You may also be interested in

Leading and trailing spaces will also be trimmed to 1, but will not be removed. Select one or several columns with the data to delete spaces between words. Press Ctrl + H to get the " Find and Replace " dialog box. Press the Space bar twice in the Find What field and once in Replace With
Click on the " Replace all " button, and then press Ok to close Excel confirmation dialog. Repeat step 4 until you see the message "We couldn't find anything to replace." :) 3 clicks to neat data with Trim Spaces tool
If you often import data to Excel from external sources and spend much time polishing up your tables, check out our Text tools for Excel. The Trim Spaces add-in will clean data imported from the web or any other external source. It removes leading and trailing spaces, excess blanks between words, non-breaking spaces, line breaks, non-printing symbols and other unwanted characters. Also, there is an option to convert words to UPPER, lower or Proper Case. And if you need to change text numbers back to the number format and delete apostrophes, this will not be a problem either.

3 ways to remove spaces between words / numbers in Excel cells 3 ways to remove spaces between words / numbers in Excel cells
3 ways to remove spaces between words / numbers in Excel cells
Trim blanks between words to 1, remove trailing / leading spaces
Use the Trim formula to remove extra spaces
Using Find & Replace to remove extra spaces between words
3 clicks to neat data with Trim Spaces tool
Remove all spaces between numbers
Using formula to remove all spaces
Video: how to remove spaces in Excel
You may also be interested in
 Use the Trim formula to remove extra spaces
Excel has the Trim formula to use for deleting extra spaces from text. Below you can find the steps showing how to use this option: Add the helper column to the end of your data. You can name it "Trim". In the first cell of the helper column ( C2 ), enter the formula to trim excess spaces =TRIM (A2)
Copy the formula across the other cells in the column. Feel free to use some tips from Enter the same formula into all selected cells at a time. Replace the original column with the one that has the cleaned data. Select all cells in the helper column and press Ctrl + C to copy data to clipboard. Now pick the first cell in the original column and press Shift + F10 or the menu button . Then just press V.
Remove the helper column.

Use the Trim formula to remove extra spaces
Excel has the Trim formula to use for deleting extra spaces from text. Below you can find the steps showing how to use this option: Add the helper column to the end of your data. You can name it "Trim". In the first cell of the helper column ( C2 ), enter the formula to trim excess spaces =TRIM (A2)
Copy the formula across the other cells in the column. Feel free to use some tips from Enter the same formula into all selected cells at a time. Replace the original column with the one that has the cleaned data. Select all cells in the helper column and press Ctrl + C to copy data to clipboard. Now pick the first cell in the original column and press Shift + F10 or the menu button . Then just press V.
Remove the helper column.

3 ways to remove spaces between words / numbers in Excel cells 3 ways to remove spaces between words / numbers in Excel cells
3 ways to remove spaces between words / numbers in Excel cells
Trim blanks between words to 1, remove trailing / leading spaces
Use the Trim formula to remove extra spaces
Using Find & Replace to remove extra spaces between words
3 clicks to neat data with Trim Spaces tool
Remove all spaces between numbers
Using formula to remove all spaces
Video: how to remove spaces in Excel
You may also be interested in
 To remove all extra spaces in your worksheet, including excess paces between words, this is what you need to do: Download and install a trial version of Ultimate Suite for Excel. Select the range in your table where you want to remove excess spaces. For new tables, I usually press Ctrl + A to process all columns in a go. Go to Ablebits Data tab and click on the Trim Spaces icon. The add-in's pane will open on the left side of your worksheet. Just select the needed checkboxes, click the Trim button and enjoy your perfectly cleaned table. Isn't it faster than with the two previous tips? If you always deal with data processing, this tool will save you hours of precious time. Want to get this and 300+ other helpful features for your Excel?

To remove all extra spaces in your worksheet, including excess paces between words, this is what you need to do: Download and install a trial version of Ultimate Suite for Excel. Select the range in your table where you want to remove excess spaces. For new tables, I usually press Ctrl + A to process all columns in a go. Go to Ablebits Data tab and click on the Trim Spaces icon. The add-in's pane will open on the left side of your worksheet. Just select the needed checkboxes, click the Trim button and enjoy your perfectly cleaned table. Isn't it faster than with the two previous tips? If you always deal with data processing, this tool will save you hours of precious time. Want to get this and 300+ other helpful features for your Excel?

3 ways to remove spaces between words / numbers in Excel cells 3 ways to remove spaces between words / numbers in Excel cells
3 ways to remove spaces between words / numbers in Excel cells
Trim blanks between words to 1, remove trailing / leading spaces
Use the Trim formula to remove extra spaces
Using Find & Replace to remove extra spaces between words
3 clicks to neat data with Trim Spaces tool
Remove all spaces between numbers
Using formula to remove all spaces
Video: how to remove spaces in Excel
You may also be interested in
 how to remove spaces in Excel
Trim blanks between words to 1, remove trailing / leading spaces
For example, you have a table with 2 columns. In the column Name, the first cell contains "John Doe" written correctly without excess spaces. All other cells have extra blanks between the first and the last names. At the same time these cells have irrelevant blanks before and after the full names known as leading and trailing spaces. The second column is called Length and shows the number of symbols in each name: Use the Trim formula to remove extra spaces
Excel has the Trim formula to use for deleting extra spaces from text. Below you can find the steps showing how to use this option: Add the helper column to the end of your data. You can name it "Trim". In the first cell of the helper column ( C2 ), enter the formula to trim excess spaces =TRIM (A2)
Copy the formula across the other cells in the column.

how to remove spaces in Excel
Trim blanks between words to 1, remove trailing / leading spaces
For example, you have a table with 2 columns. In the column Name, the first cell contains "John Doe" written correctly without excess spaces. All other cells have extra blanks between the first and the last names. At the same time these cells have irrelevant blanks before and after the full names known as leading and trailing spaces. The second column is called Length and shows the number of symbols in each name: Use the Trim formula to remove extra spaces
Excel has the Trim formula to use for deleting extra spaces from text. Below you can find the steps showing how to use this option: Add the helper column to the end of your data. You can name it "Trim". In the first cell of the helper column ( C2 ), enter the formula to trim excess spaces =TRIM (A2)
Copy the formula across the other cells in the column.

How to Remove Leading Blank Spaces in Excel | Small Business - Chron.com How to Remove Leading Blank Spaces in Excel
How to Remove Leading Blank Spaces in Excel
1
2
3
4
5
 How to Remove Leading Blank Spaces in Excel | Small Business - Chron.com
How to Remove Leading Blank Spaces in Excel
Small Business
|
Accounting & Bookkeeping
|
Excel
By Elizabeth Mott
However carefully you monitor the data you enter and import into Microsoft Excel, and the output of formulas and functions that produce new values, it's easy to wind up with cells that contain one or more spaces as their first characters. You may see leading spaces like these in cells that hold the results of a process designed to split a first name from a last name in cells that contain both together. Removing these leading spaces – or trailing spaces that fall at the end of a cell's contents – requires an Excel function. 1
Click in the first cell of a blank column on your spreadsheet. Type an equal sign to signal Excel that the cell will contain a formula. 2
Type "TRIM (" – without quotation marks – and click on the location of the first cell in the column that contains data you want to clean up. Type a closing parenthesis to complete the formula. Press the "Enter" key. 3
Click on the bottom-right corner of the cell into which you typed your formula. When your cursor changes to a black plus sign, click and drag downward until you reach and fill the cell in the same row as the last value in the column of data you're tidying up.

How to Remove Leading Blank Spaces in Excel | Small Business - Chron.com

How to Remove Leading Blank Spaces in Excel
How to Remove Leading Blank Spaces in Excel
1
2
3
4
5

How to Remove Leading Blank Spaces in Excel | Small Business - Chron.com
How to Remove Leading Blank Spaces in Excel
Small Business
|
Accounting & Bookkeeping
|
Excel
By Elizabeth Mott
However carefully you monitor the data you enter and import into Microsoft Excel, and the output of formulas and functions that produce new values, it's easy to wind up with cells that contain one or more spaces as their first characters. You may see leading spaces like these in cells that hold the results of a process designed to split a first name from a last name in cells that contain both together. Removing these leading spaces – or trailing spaces that fall at the end of a cell's contents – requires an Excel function. 1
Click in the first cell of a blank column on your spreadsheet. Type an equal sign to signal Excel that the cell will contain a formula. 2
Type "TRIM (" – without quotation marks – and click on the location of the first cell in the column that contains data you want to clean up. Type a closing parenthesis to complete the formula. Press the "Enter" key. 3
Click on the bottom-right corner of the cell into which you typed your formula. When your cursor changes to a black plus sign, click and drag downward until you reach and fill the cell in the same row as the last value in the column of data you're tidying up.

3 ways to remove spaces between words / numbers in Excel cells 3 ways to remove spaces between words / numbers in Excel cells
3 ways to remove spaces between words / numbers in Excel cells
Trim blanks between words to 1, remove trailing / leading spaces
Use the Trim formula to remove extra spaces
Using Find & Replace to remove extra spaces between words
3 clicks to neat data with Trim Spaces tool
Remove all spaces between numbers
Using formula to remove all spaces
Video: how to remove spaces in Excel
You may also be interested in
 3 clicks to neat data with Trim Spaces tool
If you often import data to Excel from external sources and spend much time polishing up your tables, check out our Text tools for Excel. The Trim Spaces add-in will clean data imported from the web or any other external source. It removes leading and trailing spaces, excess blanks between words, non-breaking spaces, line breaks, non-printing symbols and other unwanted characters. Also, there is an option to convert words to UPPER, lower or Proper Case. And if you need to change text numbers back to the number format and delete apostrophes, this will not be a problem either. To remove all extra spaces in your worksheet, including excess paces between words, this is what you need to do: Download and install a trial version of Ultimate Suite for Excel. Select the range in your table where you want to remove excess spaces. For new tables, I usually press Ctrl + A to process all columns in a go. Go to Ablebits Data tab and click on the Trim Spaces icon.

3 clicks to neat data with Trim Spaces tool
If you often import data to Excel from external sources and spend much time polishing up your tables, check out our Text tools for Excel. The Trim Spaces add-in will clean data imported from the web or any other external source. It removes leading and trailing spaces, excess blanks between words, non-breaking spaces, line breaks, non-printing symbols and other unwanted characters. Also, there is an option to convert words to UPPER, lower or Proper Case. And if you need to change text numbers back to the number format and delete apostrophes, this will not be a problem either. To remove all extra spaces in your worksheet, including excess paces between words, this is what you need to do: Download and install a trial version of Ultimate Suite for Excel. Select the range in your table where you want to remove excess spaces. For new tables, I usually press Ctrl + A to process all columns in a go. Go to Ablebits Data tab and click on the Trim Spaces icon.

How to remove blank spaces in Excel - leading, trailing, non-breaking How to remove spaces in Excel - leading, trailing, non-breaking
How to remove spaces in Excel - leading, trailing, non-breaking
How to remove blank spaces in Excel - leading, trailing, between words
=TRIM (A2)
How to delete line breaks and nonprinting characters
=TRIM (CLEAN (A2))
How to remove non-breaking spaces in Excel
=TRIM (SUBSTITUTE (A2, CHAR (160), " "))
=TRIM (CLEAN ( (SUBSTITUTE (A2,CHAR (160)," "))))
How to delete a specific non-printing character
=TRIM (SUBSTITUTE (SUBSTITUTE (A2, CHAR (127), " "), CHAR (160), " ")))
How to remove all spaces in Excel
=SUBSTITUTE (A2, CHAR (32), "")
=SUBSTITUTE (A2," ","")
How to count spaces in Excel
=LEN (A2)-LEN (SUBSTITUTE (A2," ",""))
=LEN (A2)-LEN (TRIM (A2))
Formula-free way to remove spaces and clean data
You may also be interested in
 Select the cells (range, entire column or row) where you want to delete extra spaces. Click the Trim Spaces button on the Ablebits Data tab. Choose one or several options: Remove leading and trailing spaces
Trim extra spaces between words to one
Delete non-breaking spaces ( )
Click the Trim button. Done! All extra spaces are deleted in a single click. This is how you can quickly remove spaces in Excel cells. If you ar

Select the cells (range, entire column or row) where you want to delete extra spaces. Click the Trim Spaces button on the Ablebits Data tab. Choose one or several options: Remove leading and trailing spaces
Trim extra spaces between words to one
Delete non-breaking spaces ( )
Click the Trim button. Done! All extra spaces are deleted in a single click. This is how you can quickly remove spaces in Excel cells. If you ar

Remove Spaces at the End + Beginning of a Cell in Excel (+ video tutorial)
 Extra spaces at the end of cells can make it hard to correctly join text from different cells or use other features like Flash Fill. Using TRIM to clean up these spaces will make your spreadsheet easier to use. How to Use TRIM in Excel
Using TRIM in Excel is pretty easy! Find a space in your spreadsheet where you can enter the TRIM function – next to your data is usually the easiest
Type =TRIM (cell to TRIM)
In the parentheses, enter the cell address that you want to trim extra spaces from
Press Enter when done
Example of TRIM Function in Excel
Apply TRIM to Multiple Cells at the Same Time
You can also apply TRIM to a range of cells at once either by: Dragging down your original TRIM function
Using copy and paste to apply it to other cells
Referencing the cell range in your TRIM function or
Assigning a Defined Name to your data range and referencing that name in your TRIM Function
Example of Applying TRIM to Range of Cells
NOTE: When you reference a range of cells inside your TRIM function, the results will be grouped (you’ll see a blue outline if you place your cursor in one of the results). This means that they cannot be edited or deleted. Doing so will cause an error for all the results in the group. Unless…
You replace the TRIM function results with only their values (i.e., removing the calculation). To do this:

Remove Spaces at the End + Beginning of a Cell in Excel (+ video tutorial)

Extra spaces at the end of cells can make it hard to correctly join text from different cells or use other features like Flash Fill. Using TRIM to clean up these spaces will make your spreadsheet easier to use. How to Use TRIM in Excel
Using TRIM in Excel is pretty easy! Find a space in your spreadsheet where you can enter the TRIM function – next to your data is usually the easiest
Type =TRIM (cell to TRIM)
In the parentheses, enter the cell address that you want to trim extra spaces from
Press Enter when done
Example of TRIM Function in Excel
Apply TRIM to Multiple Cells at the Same Time
You can also apply TRIM to a range of cells at once either by: Dragging down your original TRIM function
Using copy and paste to apply it to other cells
Referencing the cell range in your TRIM function or
Assigning a Defined Name to your data range and referencing that name in your TRIM Function
Example of Applying TRIM to Range of Cells
NOTE: When you reference a range of cells inside your TRIM function, the results will be grouped (you’ll see a blue outline if you place your cursor in one of the results). This means that they cannot be edited or deleted. Doing so will cause an error for all the results in the group. Unless…
You replace the TRIM function results with only their values (i.e., removing the calculation). To do this:

Unnecessary Blank Characters in Cells in Excel 2010 Unnecessary Blank Characters in Cells in Excel 2010
Unnecessary Blank Characters in Cells in Excel 2010
Previous
 Unnecessary Blank Characters in Cells in Excel 2010
Unnecessary Blank Characters in Cells in Excel 2010
In this article we will learn how to delete the unnecessary blank character from a cell, we will use “TRIM” function in Microsoft Excel 2010. TRIM: Trim function is used to remove additional leading and trailing spaces from the text in a cell. Syntax of “TRIM” function: =TRIM (text)
Example: Cell A2 contains the text“Excel Tips”
Enter the formula in cell B2 =TRIM (A2), press Enter on your keyboard
The function will return the text after deleting the unnecessary spaces. Let’s take an example to understand how and where we can use TRIM function. For Example:- We have 2 data sets, 1 st data is having all details, and we want the 2 nd data to pick the date of joining, by using the Employee name. Employee names are with spaces, and we will use here TRIM function along with Vlookup function. Follow below given steps:-
Write the formula in cell F2.

Unnecessary Blank Characters in Cells in Excel 2010

Unnecessary Blank Characters in Cells in Excel 2010
Unnecessary Blank Characters in Cells in Excel 2010
Previous

Unnecessary Blank Characters in Cells in Excel 2010
Unnecessary Blank Characters in Cells in Excel 2010
In this article we will learn how to delete the unnecessary blank character from a cell, we will use “TRIM” function in Microsoft Excel 2010. TRIM: Trim function is used to remove additional leading and trailing spaces from the text in a cell. Syntax of “TRIM” function: =TRIM (text)
Example: Cell A2 contains the text“Excel Tips”
Enter the formula in cell B2 =TRIM (A2), press Enter on your keyboard
The function will return the text after deleting the unnecessary spaces. Let’s take an example to understand how and where we can use TRIM function. For Example:- We have 2 data sets, 1 st data is having all details, and we want the 2 nd data to pick the date of joining, by using the Employee name. Employee names are with spaces, and we will use here TRIM function along with Vlookup function. Follow below given steps:-
Write the formula in cell F2.

3 ways to remove spaces between words / numbers in Excel cells 3 ways to remove spaces between words / numbers in Excel cells
3 ways to remove spaces between words / numbers in Excel cells
Trim blanks between words to 1, remove trailing / leading spaces
Use the Trim formula to remove extra spaces
Using Find & Replace to remove extra spaces between words
3 clicks to neat data with Trim Spaces tool
Remove all spaces between numbers
Using formula to remove all spaces
Video: how to remove spaces in Excel
You may also be interested in
 Feel free to use some tips from Enter the same formula into all selected cells at a time. Replace the original column with the one that has the cleaned data. Select all cells in the helper column and press Ctrl + C to copy data to clipboard. Now pick the first cell in the original column and press Shift + F10 or the menu button . Then just press V.
Remove the helper column. That's it! We deleted all excess blanks with the help of the formula trim (). Unfortunately, it's a bit time-consuming, especially if your spreadsheet is rather big. Note: If after using the formula you still see extra spaces (the last cell on the screenshot), please have a look at If the TRIM Function Doesn't Work
Using Find & Replace to remove extra spaces between words
This option needs fewer steps, but allows only deleting excess spaces between words.

Feel free to use some tips from Enter the same formula into all selected cells at a time. Replace the original column with the one that has the cleaned data. Select all cells in the helper column and press Ctrl + C to copy data to clipboard. Now pick the first cell in the original column and press Shift + F10 or the menu button . Then just press V.
Remove the helper column. That's it! We deleted all excess blanks with the help of the formula trim (). Unfortunately, it's a bit time-consuming, especially if your spreadsheet is rather big. Note: If after using the formula you still see extra spaces (the last cell on the screenshot), please have a look at If the TRIM Function Doesn't Work
Using Find & Replace to remove extra spaces between words
This option needs fewer steps, but allows only deleting excess spaces between words.

Learn How to Remove Extra Spaces From Excel Using TRIM How to Remove Extra Spaces From Excel
How to Remove Extra Spaces From Excel
An easier way to clean up your Excel spreadsheet
How the TRIM Function Works
Using the TRIM Function
Removing Extra Spaces From an Entire Column
Using the Search and Replace Short Cut Key
Was this page helpful?
 Click on the top empty cell in your new column (B2). Type =TRIM (B2) and press Enter. Hold down the Shift key, and hover your mouse at the bottom of cell B2 until the cursor changes to two horizontal lines with an arrow above and below them. ( This feature isn't available in Excel Online; you'll have to use the Fill Handle to copy the formula.) Double-click the right mouse button to auto-fill the entire column
Now you'll have column A with the extra spaces, and column B with the same text cleaned up. Perform the same copy and paste (values only) procedure in the previous step, but copy and paste the entire columns rather than just individual cells. Finally, right click at the top of column B to highlight the entire column, and delete it, shifting all other cells on the spreadsheet to the left. Using the Search and Replace Short Cut Key
If the text in your column has extra spaces within the text, not right before or right after, you can quickly clean that text by using Excel's Search and Replace feature. Select the entire column you want to clean.

Learn How to Remove Extra Spaces From Excel Using TRIM

How to Remove Extra Spaces From Excel
How to Remove Extra Spaces From Excel
An easier way to clean up your Excel spreadsheet
How the TRIM Function Works
Using the TRIM Function
Removing Extra Spaces From an Entire Column
Using the Search and Replace Short Cut Key
Was this page helpful?

Click on the top empty cell in your new column (B2). Type =TRIM (B2) and press Enter. Hold down the Shift key, and hover your mouse at the bottom of cell B2 until the cursor changes to two horizontal lines with an arrow above and below them. ( This feature isn't available in Excel Online; you'll have to use the Fill Handle to copy the formula.) Double-click the right mouse button to auto-fill the entire column
Now you'll have column A with the extra spaces, and column B with the same text cleaned up. Perform the same copy and paste (values only) procedure in the previous step, but copy and paste the entire columns rather than just individual cells. Finally, right click at the top of column B to highlight the entire column, and delete it, shifting all other cells on the spreadsheet to the left. Using the Search and Replace Short Cut Key
If the text in your column has extra spaces within the text, not right before or right after, you can quickly clean that text by using Excel's Search and Replace feature. Select the entire column you want to clean.

Excel TRIM function - quick way to remove extra spaces Excel TRIM function - quick way to remove extra spaces
Excel TRIM function - quick way to remove extra spaces
TRIM function - remove extra spaces in Excel
TRIM (text)
=TRIM (A1)
=TRIM (CLEAN (A1))
How to use TRIM function in Excel - formula examples
How to trim spaces in an entire column of data
How to remove leading spaces in a numeric column
=VALUE (TRIM (A2))
How to remove only leading spaces in Excel (Left Trim)
=MID (A2,FIND (MID (TRIM (A2),1,1),A2),LEN (A2))
How to count extra spaces in a cell
=LEN (A2)-LEN (TRIM (A2))
How to highlight cells with excess spaces
=LEN ($A2)>LEN (TRIM ($A2))
Excel TRIM not working
=TRIM (SUBSTITUTE (A1, CHAR (160), " "))
=TRIM (CLEAN (SUBSTITUTE (A1, CHAR (160), " ")))
Leading space: =CODE (LEFT (A1,1))
Trailing space: =CODE (RIGHT (A1,1))
=CODE (MID (A1, n, 1)))
=TRIM (SUBSTITUTE (A1, CHAR (9), " "))
Trim Spaces for Excel - remove extra spaces in a click
Available downloads
You may also be interested in
 These are only a few examples of problems that you may be seeking answers to. And all are caused by extra spaces hiding before, after or between numeric and text values in your cells. Microsoft Excel offers a few different ways to remove spaces and clean up your data. In this tutorial, we will investigate the capabilities of the TRIM function as the fastest and easiest way to delete spaces in Excel. Excel TRIM function syntax
How to use TRIM in Excel - formula examples
Trim spaces in an entire column of data
Delete leading spaces in a numeric column
Remove leading spaces only (Left Trim)
Count extra spaces in cells
Highlight cells with any excess spaces
Excel TRIM not working - reasons and solutions
One-click way to trim spaces in Excel
TRIM function - remove extra spaces in Excel
You use the TRIM function in Excel removes extra spaces from text. It deletes all leading, trailing and in-between spaces except for a single space character between words. The syntax of the TRIM function is the easiest one could imagine: TRIM (text)
Where text is a cell that you want to remove excess spaces from. For example, to remove spaces in cell A1, you use this formula: =TRIM (A1)
And the following screenshot shows the result:

Excel TRIM function - quick way to remove extra spaces

Excel TRIM function - quick way to remove extra spaces
Excel TRIM function - quick way to remove extra spaces
TRIM function - remove extra spaces in Excel
TRIM (text)
=TRIM (A1)
=TRIM (CLEAN (A1))
How to use TRIM function in Excel - formula examples
How to trim spaces in an entire column of data
How to remove leading spaces in a numeric column
=VALUE (TRIM (A2))
How to remove only leading spaces in Excel (Left Trim)
=MID (A2,FIND (MID (TRIM (A2),1,1),A2),LEN (A2))
How to count extra spaces in a cell
=LEN (A2)-LEN (TRIM (A2))
How to highlight cells with excess spaces
=LEN ($A2)>LEN (TRIM ($A2))
Excel TRIM not working
=TRIM (SUBSTITUTE (A1, CHAR (160), " "))
=TRIM (CLEAN (SUBSTITUTE (A1, CHAR (160), " ")))
Leading space: =CODE (LEFT (A1,1))
Trailing space: =CODE (RIGHT (A1,1))
=CODE (MID (A1, n, 1)))
=TRIM (SUBSTITUTE (A1, CHAR (9), " "))
Trim Spaces for Excel - remove extra spaces in a click
Available downloads
You may also be interested in

These are only a few examples of problems that you may be seeking answers to. And all are caused by extra spaces hiding before, after or between numeric and text values in your cells. Microsoft Excel offers a few different ways to remove spaces and clean up your data. In this tutorial, we will investigate the capabilities of the TRIM function as the fastest and easiest way to delete spaces in Excel. Excel TRIM function syntax
How to use TRIM in Excel - formula examples
Trim spaces in an entire column of data
Delete leading spaces in a numeric column
Remove leading spaces only (Left Trim)
Count extra spaces in cells
Highlight cells with any excess spaces
Excel TRIM not working - reasons and solutions
One-click way to trim spaces in Excel
TRIM function - remove extra spaces in Excel
You use the TRIM function in Excel removes extra spaces from text. It deletes all leading, trailing and in-between spaces except for a single space character between words. The syntax of the TRIM function is the easiest one could imagine: TRIM (text)
Where text is a cell that you want to remove excess spaces from. For example, to remove spaces in cell A1, you use this formula: =TRIM (A1)
And the following screenshot shows the result:

3 ways to remove spaces between words / numbers in Excel cells 3 ways to remove spaces between words / numbers in Excel cells
3 ways to remove spaces between words / numbers in Excel cells
Trim blanks between words to 1, remove trailing / leading spaces
Use the Trim formula to remove extra spaces
Using Find & Replace to remove extra spaces between words
3 clicks to neat data with Trim Spaces tool
Remove all spaces between numbers
Using formula to remove all spaces
Video: how to remove spaces in Excel
You may also be interested in
 3 ways to remove spaces between words / numbers in Excel cells
Nov
15
3 ways to remove spaces between words / numbers in Excel cells
by Alexander Frolov | updated on March 4, 2021
3 quick ways to remove extra spaces between words or delete all spaces from Excel cells. You can use trim formula, Excel Find & replace or special Excel add-in to clean up cells' content. When you paste data from an external source to an Excel spreadsheet (plain text reports, numbers from web pages, etc.), you are likely to get extra spaces along with important data. There can be leading and trailing spaces, several blanks between words and thousand separators for numbers. Consequently, your table looks disorderly and becomes difficult to use. It may be a challenge to find a customer in the Name column since you search for "John Doe" which has no excess spaces between the names while the way it looks in your table is "John Doe". Or numbers can't be summed up, and again extra blanks are the ones to blame. In this article you'll find how to clean up your data. Trim blanks between words to 1, remove trailing / leading spaces
Using trim formula
Employ the Find & Replace option
3 clicks to neat data with Trim Spaces tool
Remove All spaces between numbers or words
Video:

3 ways to remove spaces between words / numbers in Excel cells
Nov
15
3 ways to remove spaces between words / numbers in Excel cells
by Alexander Frolov | updated on March 4, 2021
3 quick ways to remove extra spaces between words or delete all spaces from Excel cells. You can use trim formula, Excel Find & replace or special Excel add-in to clean up cells' content. When you paste data from an external source to an Excel spreadsheet (plain text reports, numbers from web pages, etc.), you are likely to get extra spaces along with important data. There can be leading and trailing spaces, several blanks between words and thousand separators for numbers. Consequently, your table looks disorderly and becomes difficult to use. It may be a challenge to find a customer in the Name column since you search for "John Doe" which has no excess spaces between the names while the way it looks in your table is "John Doe". Or numbers can't be summed up, and again extra blanks are the ones to blame. In this article you'll find how to clean up your data. Trim blanks between words to 1, remove trailing / leading spaces
Using trim formula
Employ the Find & Replace option
3 clicks to neat data with Trim Spaces tool
Remove All spaces between numbers or words
Video:

Excel TRIM function - quick way to remove extra spaces Excel TRIM function - quick way to remove extra spaces
Excel TRIM function - quick way to remove extra spaces
TRIM function - remove extra spaces in Excel
TRIM (text)
=TRIM (A1)
=TRIM (CLEAN (A1))
How to use TRIM function in Excel - formula examples
How to trim spaces in an entire column of data
How to remove leading spaces in a numeric column
=VALUE (TRIM (A2))
How to remove only leading spaces in Excel (Left Trim)
=MID (A2,FIND (MID (TRIM (A2),1,1),A2),LEN (A2))
How to count extra spaces in a cell
=LEN (A2)-LEN (TRIM (A2))
How to highlight cells with excess spaces
=LEN ($A2)>LEN (TRIM ($A2))
Excel TRIM not working
=TRIM (SUBSTITUTE (A1, CHAR (160), " "))
=TRIM (CLEAN (SUBSTITUTE (A1, CHAR (160), " ")))
Leading space: =CODE (LEFT (A1,1))
Trailing space: =CODE (RIGHT (A1,1))
=CODE (MID (A1, n, 1)))
=TRIM (SUBSTITUTE (A1, CHAR (9), " "))
Trim Spaces for Excel - remove extra spaces in a click
Available downloads
You may also be interested in
 So, how do you remove all leading, trailing and excess in-between spaces in all cells at a time? By copying an Excel TRIM formula across the column, and then replacing formulas with their values. The detailed steps follow below. Write a TRIM formula for the topmost cell, A2 in our example: =TRIM (A2)
Position the cursor to the lower right corner of the formula cell (B2 in this example), and as soon as the cursor turns into the plus sign, double-click it to copy the formula down the column, up to the last cell with data. As the result, you will have 2 columns - original names with spaces and formula-driven trimmed names. Finally, replace the values in the original column with the trimmed data. But be careful! Simply copying the trimmed column over the original column would destroy your formulas. To prevent this from happening, you need to copy only values, not formulas.

So, how do you remove all leading, trailing and excess in-between spaces in all cells at a time? By copying an Excel TRIM formula across the column, and then replacing formulas with their values. The detailed steps follow below. Write a TRIM formula for the topmost cell, A2 in our example: =TRIM (A2)
Position the cursor to the lower right corner of the formula cell (B2 in this example), and as soon as the cursor turns into the plus sign, double-click it to copy the formula down the column, up to the last cell with data. As the result, you will have 2 columns - original names with spaces and formula-driven trimmed names. Finally, replace the values in the original column with the trimmed data. But be careful! Simply copying the trimmed column over the original column would destroy your formulas. To prevent this from happening, you need to copy only values, not formulas.

Trim spaces from Excel cell - free addin Remove leading and trailing spaces from Excel worksheets
Remove leading and trailing spaces from Excel worksheets
Trim Spaces for Microsoft Excel 2010-2000
How to remove extra spaces with Trim Spaces for Excel
If your cells have more than just leading and trailing spaces
Trim Spaces for Microsoft Excel system requirements
Microsoft Excel
Operating System
Trim Spaces for Microsoft Excel version
Add-in vendor
 Trim spaces from Excel cell - free addin
Remove leading and trailing spaces from Excel worksheets
Trim Spaces for Microsoft Excel 2010-2000
The Trim Spaces for Excel add-in will help you quickly remove leading and trailing spaces in the selected cells, columns, rows or the entire table. Just select the region that you want to clear up, click the "Run" button of the add-in and no excess spaces are left in your worksheet. Free Download
Freeware

Features
Requirements
How to remove extra spaces with Trim Spaces for Excel
In your Microsoft Excel worksheet, select the cells, columns or rows from which you want to remove excess spaces. Start the Trim Spaces by clicking on its icon, or go to Excel Menu Ablebits.com -> Trim Spaces for Excel . If you have Excel 2007 or 2010, you can find it on the Ablebits.com tab on the Ribbon. Click the " Run " button and enjoy the results! If your cells have more than just leading and trailing spaces
Extra spaces between the words, non-breaking spaces, other formatting issues like numbers stored as text or words written in a wrong case can all hamper your work with data in Excel. In this case your best aid is the Cell Cleaner add-in. Besides cleaning up cells in your worksheets, this advanced tool can process larger volumes of data as it supports all Excel versions from 2003 to 2013 32 and 64-bit. Trim Spaces for Microsoft Excel system requirements
Microsoft Excel
Microsoft Excel 2010 (32bit)
Microsoft Excel 2007
Microsoft Excel 2003
Operating System
Windows 10 (32 and 64-bit)
Windows 8 (32 and 64-bit)
Windows 7 (32 and 64-bit)
Windows Vista (32 and 64-bit)
Windows XP (32-bit)
Windows Server 2003, 2008, 2012
Trim Spaces for Microsoft Excel version
Current add-in version:

Trim spaces from Excel cell - free addin

Remove leading and trailing spaces from Excel worksheets
Remove leading and trailing spaces from Excel worksheets
Trim Spaces for Microsoft Excel 2010-2000
How to remove extra spaces with Trim Spaces for Excel
If your cells have more than just leading and trailing spaces
Trim Spaces for Microsoft Excel system requirements
Microsoft Excel
Operating System
Trim Spaces for Microsoft Excel version
Add-in vendor

How to remove blank spaces in Excel - leading, trailing, non-breaking How to remove spaces in Excel - leading, trailing, non-breaking
How to remove spaces in Excel - leading, trailing, non-breaking
How to remove blank spaces in Excel - leading, trailing, between words
=TRIM (A2)
How to delete line breaks and nonprinting characters
=TRIM (CLEAN (A2))
How to remove non-breaking spaces in Excel
=TRIM (SUBSTITUTE (A2, CHAR (160), " "))
=TRIM (CLEAN ( (SUBSTITUTE (A2,CHAR (160)," "))))
How to delete a specific non-printing character
=TRIM (SUBSTITUTE (SUBSTITUTE (A2, CHAR (127), " "), CHAR (160), " ")))
How to remove all spaces in Excel
=SUBSTITUTE (A2, CHAR (32), "")
=SUBSTITUTE (A2," ","")
How to count spaces in Excel
=LEN (A2)-LEN (SUBSTITUTE (A2," ",""))
=LEN (A2)-LEN (TRIM (A2))
Formula-free way to remove spaces and clean data
You may also be interested in
 And now, you only need to replace values in the original column with trimmed values. The easiest way to do this is using Paste Special > Values, the detailed instructions can be found here: How to copy values in Excel. Additionally, you can use the Excel TRIM function to remove leading spaces only, keeping all spaces in the middle of a text string intact. The formula example is here: How to trim leading spaces in Excel (Left Trim)
How to delete line breaks and nonprinting characters
When you import data from external sources, it's not only extra spaces that come along, but also various non-printing characters like carriage return, line feed, vertical or horizontal tab, etc. The TRIM function can get rid of white spaces, but it cannot eliminate non-printing characters. Technically, Excel TRIM is designed to only delete value 32 in the 7-bit ASCII system, which is the space character. To remove spaces and non-printing characters in a string, use TRIM in combination with the CLEAN function. As its names suggests, CLEAN is purposed for cleaning data, and it can delete any and all of the first 32 non-printing characters in the in the 7-bit ASCII set (values 0 through 31) including line break (value 10).

And now, you only need to replace values in the original column with trimmed values. The easiest way to do this is using Paste Special > Values, the detailed instructions can be found here: How to copy values in Excel. Additionally, you can use the Excel TRIM function to remove leading spaces only, keeping all spaces in the middle of a text string intact. The formula example is here: How to trim leading spaces in Excel (Left Trim)
How to delete line breaks and nonprinting characters
When you import data from external sources, it's not only extra spaces that come along, but also various non-printing characters like carriage return, line feed, vertical or horizontal tab, etc. The TRIM function can get rid of white spaces, but it cannot eliminate non-printing characters. Technically, Excel TRIM is designed to only delete value 32 in the 7-bit ASCII system, which is the space character. To remove spaces and non-printing characters in a string, use TRIM in combination with the CLEAN function. As its names suggests, CLEAN is purposed for cleaning data, and it can delete any and all of the first 32 non-printing characters in the in the 7-bit ASCII set (values 0 through 31) including line break (value 10).

3 ways to remove spaces between words / numbers in Excel cells 3 ways to remove spaces between words / numbers in Excel cells
3 ways to remove spaces between words / numbers in Excel cells
Trim blanks between words to 1, remove trailing / leading spaces
Use the Trim formula to remove extra spaces
Using Find & Replace to remove extra spaces between words
3 clicks to neat data with Trim Spaces tool
Remove all spaces between numbers
Using formula to remove all spaces
Video: how to remove spaces in Excel
You may also be interested in
 That's it! We deleted all excess blanks with the help of the formula trim (). Unfortunately, it's a bit time-consuming, especially if your spreadsheet is rather big. Note: If after using the formula you still see extra spaces (the last cell on the screenshot), please have a look at If the TRIM Function Doesn't Work
Using Find & Replace to remove extra spaces between words
This option needs fewer steps, but allows only deleting excess spaces between words. Leading and trailing spaces will also be trimmed to 1, but will not be removed. Select one or several columns with the data to delete spaces between words. Press Ctrl + H to get the " Find and Replace " dialog box. Press the Space bar twice in the Find What field and once in Replace With
Click on the " Replace all " button, and then press Ok to close Excel confirmation dialog. Repeat step 4 until you see the message "We couldn't find anything to replace." :)

That's it! We deleted all excess blanks with the help of the formula trim (). Unfortunately, it's a bit time-consuming, especially if your spreadsheet is rather big. Note: If after using the formula you still see extra spaces (the last cell on the screenshot), please have a look at If the TRIM Function Doesn't Work
Using Find & Replace to remove extra spaces between words
This option needs fewer steps, but allows only deleting excess spaces between words. Leading and trailing spaces will also be trimmed to 1, but will not be removed. Select one or several columns with the data to delete spaces between words. Press Ctrl + H to get the " Find and Replace " dialog box. Press the Space bar twice in the Find What field and once in Replace With
Click on the " Replace all " button, and then press Ok to close Excel confirmation dialog. Repeat step 4 until you see the message "We couldn't find anything to replace." :)

Remove Extra Spaces from Excel Data | Pryor Learning Solutions Remove Extra Spaces from Excel Data
Remove Extra Spaces from Excel Data
Use the Trim Function
Use a Formula to Remove All Spaces
Bonus Hint!
Tepring Crocker
 Option 2
Use a Formula to Remove All Spaces
If you need to prepare your data for import into a database (such as MS Access) or have a combination of number and text data that simply needs ALL spaces removed, you can use a formula instead of the TRIM function to remove ALL blanks in a cell. Step 1
Create a temporary, or helper, column for the corrected data at the end of your spreadsheet like you did for the TRIM function. In this example the column is called No Spaces. Step 2
Click in the first cell of the Trim column. On the Formulas tab, click the Text dropdown menu in the Functions group and select SUBSTITUTE. Step 3
When the dialog box appears: Click on the first cell in the column that you need changed
In the “Old_text” field, enter the character you want replaced separated by quotes. To remove spaces this would then be ” “. In the “New_text” field, enter the character you want to appear instead. Since we want NO characters to replace the space, type “”.

Remove Extra Spaces from Excel Data | Pryor Learning Solutions

Remove Extra Spaces from Excel Data
Remove Extra Spaces from Excel Data
Use the Trim Function
Use a Formula to Remove All Spaces
Bonus Hint!
Tepring Crocker

Option 2
Use a Formula to Remove All Spaces
If you need to prepare your data for import into a database (such as MS Access) or have a combination of number and text data that simply needs ALL spaces removed, you can use a formula instead of the TRIM function to remove ALL blanks in a cell. Step 1
Create a temporary, or helper, column for the corrected data at the end of your spreadsheet like you did for the TRIM function. In this example the column is called No Spaces. Step 2
Click in the first cell of the Trim column. On the Formulas tab, click the Text dropdown menu in the Functions group and select SUBSTITUTE. Step 3
When the dialog box appears: Click on the first cell in the column that you need changed
In the “Old_text” field, enter the character you want replaced separated by quotes. To remove spaces this would then be ” “. In the “New_text” field, enter the character you want to appear instead. Since we want NO characters to replace the space, type “”.

VBA Trim | How to use VBA Trim Function to Remove Spaces in Excel? VBA TRIM
VBA TRIM
Excel VBA Trim Function
How to Use Excel VBA Trim Function?
VBA Trim Function – Example #1
Code:
Code:
VBA Trim Function – Example #2
Code:
Pros of Excel VBA Trim Function
Things To Remember
Recommended Articles
 Cell A2 has spaces at the beginning of the text. And cell A3 has space in between the text which is highlighted in the below screenshot. For trimming these cells we will use Excel VBA. For that, press Alt + F11 keys together or under Developer tab click on Visual Basic as shown below. This will take us to Visual Basic coding window. Now go to the Insert menu from VBA window and select Module as shown below. This will create a new Module where we will write a code for trimming. Below are the steps for creating and writing trimming code: First, choose a variable and define a range. Here we have selected the variable “A”.

VBA Trim | How to use VBA Trim Function to Remove Spaces in Excel?

VBA TRIM
VBA TRIM
Excel VBA Trim Function
How to Use Excel VBA Trim Function?
VBA Trim Function – Example #1
Code:
Code:
VBA Trim Function – Example #2
Code:
Pros of Excel VBA Trim Function
Things To Remember
Recommended Articles

Cell A2 has spaces at the beginning of the text. And cell A3 has space in between the text which is highlighted in the below screenshot. For trimming these cells we will use Excel VBA. For that, press Alt + F11 keys together or under Developer tab click on Visual Basic as shown below. This will take us to Visual Basic coding window. Now go to the Insert menu from VBA window and select Module as shown below. This will create a new Module where we will write a code for trimming. Below are the steps for creating and writing trimming code: First, choose a variable and define a range. Here we have selected the variable “A”.

How to Remove Whitespace From a String in Excel | Small Business - Chron.com How to Remove Whitespace From a String in Excel
How to Remove Whitespace From a String in Excel
1
2
3
 however, it cannot remove non-breaking spaces – this requires a combination Excel's Substitute and Trim functions. 1
Open your spreadsheet in Excel and locate the cells containing the whitespace that needs to be removed. 2
Use the Trim function to remove whitespace created from normal spaces. The Trim function requires a single reference to operate. For example, entering "=TRIM (A1)" without quotes will strip all but single spaces between words from the string " this is a test " in cell A1, leaving "this is a test". 3
Use the Substitute function to change non-breaking spaces to regular spaces. For example, "=TRIM (SUBSTITUTE (A1,CHAR (160),CHAR (32)))" without the quotes replaces non-breaking spaces (ASCII character 160) in cell "A1" with standard spaces (ASCII character 32) and then trims leading, trailing and repetitive spaces. ‒‒:‒‒
/
‒‒:‒‒
Replay
Skip
Ads by
Read More
References
Microsoft: Top Ten Ways to Clean Your Data
Microsoft: Remove Spaces From the Beginning and End of a Cell
Tips
To remove whitespace in a long list of cells, copy the Trim or Substitute formula by dragging its bottom-right drag bar down the formula column.

How to Remove Whitespace From a String in Excel | Small Business - Chron.com

How to Remove Whitespace From a String in Excel
How to Remove Whitespace From a String in Excel
1
2
3

however, it cannot remove non-breaking spaces – this requires a combination Excel's Substitute and Trim functions. 1
Open your spreadsheet in Excel and locate the cells containing the whitespace that needs to be removed. 2
Use the Trim function to remove whitespace created from normal spaces. The Trim function requires a single reference to operate. For example, entering "=TRIM (A1)" without quotes will strip all but single spaces between words from the string " this is a test " in cell A1, leaving "this is a test". 3
Use the Substitute function to change non-breaking spaces to regular spaces. For example, "=TRIM (SUBSTITUTE (A1,CHAR (160),CHAR (32)))" without the quotes replaces non-breaking spaces (ASCII character 160) in cell "A1" with standard spaces (ASCII character 32) and then trims leading, trailing and repetitive spaces. ‒‒:‒‒
/
‒‒:‒‒
Replay
Skip
Ads by
Read More
References
Microsoft: Top Ten Ways to Clean Your Data
Microsoft: Remove Spaces From the Beginning and End of a Cell
Tips
To remove whitespace in a long list of cells, copy the Trim or Substitute formula by dragging its bottom-right drag bar down the formula column.

Excel TRIM function - quick way to remove extra spaces Excel TRIM function - quick way to remove extra spaces
Excel TRIM function - quick way to remove extra spaces
TRIM function - remove extra spaces in Excel
TRIM (text)
=TRIM (A1)
=TRIM (CLEAN (A1))
How to use TRIM function in Excel - formula examples
How to trim spaces in an entire column of data
How to remove leading spaces in a numeric column
=VALUE (TRIM (A2))
How to remove only leading spaces in Excel (Left Trim)
=MID (A2,FIND (MID (TRIM (A2),1,1),A2),LEN (A2))
How to count extra spaces in a cell
=LEN (A2)-LEN (TRIM (A2))
How to highlight cells with excess spaces
=LEN ($A2)>LEN (TRIM ($A2))
Excel TRIM not working
=TRIM (SUBSTITUTE (A1, CHAR (160), " "))
=TRIM (CLEAN (SUBSTITUTE (A1, CHAR (160), " ")))
Leading space: =CODE (LEFT (A1,1))
Trailing space: =CODE (RIGHT (A1,1))
=CODE (MID (A1, n, 1)))
=TRIM (SUBSTITUTE (A1, CHAR (9), " "))
Trim Spaces for Excel - remove extra spaces in a click
Available downloads
You may also be interested in
 Yep, it's that simple! If in addition to extra spaces, your data contains line breaks and non-printing characters, use the TRIM function in combination with CLEAN to delete the first 32 non-printing characters in the in the 7-bit ASCII code system. For example, to remove spaces, line breaks and other unwanted characters from cell A1, use this formula: =TRIM (CLEAN (A1))
For more information, please see How to remove non-printing characters in Excel
How to use TRIM function in Excel - formula examples
Now that you know the basics, let's discuss a few specific uses of TRIM in Excel, pitfalls that you may face and working solutions. How to trim spaces in an entire column of data
Supposing you have a column of names that have some whitespace before and after the text, as well as more than one spaces between the words. So, how do you remove all leading, trailing and excess in-between spaces in all cells at a time? By copying an Excel TRIM formula across the column, and then replacing formulas with their values. The detailed steps follow below. Write a TRIM formula for the topmost cell, A2 in our example: =TRIM (A2)
Position the cursor to the lower right corner of the formula cell (B2 in this example), and as soon as the cursor turns into the plus sign, double-click it to copy the formula down the column, up to the last cell with data.

Yep, it's that simple! If in addition to extra spaces, your data contains line breaks and non-printing characters, use the TRIM function in combination with CLEAN to delete the first 32 non-printing characters in the in the 7-bit ASCII code system. For example, to remove spaces, line breaks and other unwanted characters from cell A1, use this formula: =TRIM (CLEAN (A1))
For more information, please see How to remove non-printing characters in Excel
How to use TRIM function in Excel - formula examples
Now that you know the basics, let's discuss a few specific uses of TRIM in Excel, pitfalls that you may face and working solutions. How to trim spaces in an entire column of data
Supposing you have a column of names that have some whitespace before and after the text, as well as more than one spaces between the words. So, how do you remove all leading, trailing and excess in-between spaces in all cells at a time? By copying an Excel TRIM formula across the column, and then replacing formulas with their values. The detailed steps follow below. Write a TRIM formula for the topmost cell, A2 in our example: =TRIM (A2)
Position the cursor to the lower right corner of the formula cell (B2 in this example), and as soon as the cursor turns into the plus sign, double-click it to copy the formula down the column, up to the last cell with data.

Remove Extra Spaces from Excel Data | Pryor Learning Solutions Remove Extra Spaces from Excel Data
Remove Extra Spaces from Excel Data
Use the Trim Function
Use a Formula to Remove All Spaces
Bonus Hint!
Tepring Crocker
 However, the # of Characters column reveals that there are hidden spaces buried in the text. Step 1
To use the TRIM function, you will need to create a temporary, or helper, column for the corrected data at the end of your spreadsheet. For the purposes of this demonstration, we’ve called the column “Trim.” To follow using our example above, download Excel Remove Spaces Formula Template
Step 2
Click in the first cell of the Trim column. On the Formulas tab, click the Text dropdown menu in the Functions group and select TRIM. Step 3
After the dialog box appears, click on the cell that contains the text you would like to remove spaces from to complete the function. Click OK. Step 4
Copy the function to the remaining cells in the column to apply the function to the rest of the Name cells. You can see that the TRIM function cleaned up the extra spaces and the character counts are now all the same except for the “JoeSmith” that did not have any spaces between the first and last name. Note that TRIM will not ADD spaces.

However, the # of Characters column reveals that there are hidden spaces buried in the text. Step 1
To use the TRIM function, you will need to create a temporary, or helper, column for the corrected data at the end of your spreadsheet. For the purposes of this demonstration, we’ve called the column “Trim.” To follow using our example above, download Excel Remove Spaces Formula Template
Step 2
Click in the first cell of the Trim column. On the Formulas tab, click the Text dropdown menu in the Functions group and select TRIM. Step 3
After the dialog box appears, click on the cell that contains the text you would like to remove spaces from to complete the function. Click OK. Step 4
Copy the function to the remaining cells in the column to apply the function to the rest of the Name cells. You can see that the TRIM function cleaned up the extra spaces and the character counts are now all the same except for the “JoeSmith” that did not have any spaces between the first and last name. Note that TRIM will not ADD spaces.

Learn How to Remove Extra Spaces From Excel Using TRIM How to Remove Extra Spaces From Excel
How to Remove Extra Spaces From Excel
An easier way to clean up your Excel spreadsheet
How the TRIM Function Works
Using the TRIM Function
Removing Extra Spaces From an Entire Column
Using the Search and Replace Short Cut Key
Was this page helpful?
 Instead, click the down arrow under Paste on the Home ribbon, then select Paste Values. Removing Extra Spaces From an Entire Column
The method above works well if you're only cleaning spaces from one cell, but what if you want to remove spaces from an entire column? The procedure for dealing with a column isn't that different from dealing with one cell. In this example, the column with too many spaces starts with A2. Create a new empty column beside the column you want to remove spaces from (in this example this new column starts with B2). Click on the top empty cell in your new column (B2). Type =TRIM (B2) and press Enter. Hold down the Shift key, and hover your mouse at the bottom of cell B2 until the cursor changes to two horizontal lines with an arrow above and below them. ( This feature isn't available in Excel Online; you'll have to use the Fill Handle to copy the formula.)

Instead, click the down arrow under Paste on the Home ribbon, then select Paste Values. Removing Extra Spaces From an Entire Column
The method above works well if you're only cleaning spaces from one cell, but what if you want to remove spaces from an entire column? The procedure for dealing with a column isn't that different from dealing with one cell. In this example, the column with too many spaces starts with A2. Create a new empty column beside the column you want to remove spaces from (in this example this new column starts with B2). Click on the top empty cell in your new column (B2). Type =TRIM (B2) and press Enter. Hold down the Shift key, and hover your mouse at the bottom of cell B2 until the cursor changes to two horizontal lines with an arrow above and below them. ( This feature isn't available in Excel Online; you'll have to use the Fill Handle to copy the formula.)

VBA Remove Spaces from String in Excel | Explained with Examples VBA Remove Spaces from String in Excel
VBA Remove Spaces from String in Excel
Macro to remove extra Spaces from String in Excel VBA
VBA Code to delete extra Spaces from String in Excel
Instructions to use Macro
Other Useful VBA Text and String Functions
 VBA Remove Spaces from String in Excel | Explained with Examples
Functions, Programming, Text - String Functions / Range, Remove, Strings
VBA Remove Spaces from String in Excel
VBA Remove extra Spaces or blanks from String in Excel. Sometimes we may have more than one space in a string. To remove additional or extra spaces we use different VBA functions like LTRIM, TRIM, or RTRIM. We use LTRIM function to remove left most or starting of the string spaces. To remove right most or end of the string spaces we use RTRIM function. Finally we use TRIM function in VBA Remove Spaces macro to remove all extra spaces in a string. Table of Contents: Overview
Macro to Trim Blank Spaces from String in Excel VBA
VBA Code to remove extra Multiple Spaces from String in Excel
Instructions to use Macro
Related VBA Functions used in this article
Macro to remove extra Spaces from String in Excel VBA
Here is the best excel vba remove spaces from string macro to remove spaces in Excel. Let us see the example macros to trim,delete and remove blank spaces from String in Excel VBA. 'VBA Code to delete extra Spaces from String in Excel Sub VBA_Remove_Spaces ()  'Variable Declaration  Dim String1 As String, TempString As String  'There are multiple spaces in string  String1 = "Thanks for visiting our blog "  'Remove Extra Spaces  Do  TempString = String1  String1 = Replace (String1, Space (2), Space (1))  Loop Until TempString = String1  MsgBox "Removed Extra Spaces from String: " &

VBA Remove Spaces from String in Excel | Explained with Examples

VBA Remove Spaces from String in Excel
VBA Remove Spaces from String in Excel
Macro to remove extra Spaces from String in Excel VBA
VBA Code to delete extra Spaces from String in Excel
Instructions to use Macro
Other Useful VBA Text and String Functions

How to remove blank spaces in Excel - leading, trailing, non-breaking How to remove spaces in Excel - leading, trailing, non-breaking
How to remove spaces in Excel - leading, trailing, non-breaking
How to remove blank spaces in Excel - leading, trailing, between words
=TRIM (A2)
How to delete line breaks and nonprinting characters
=TRIM (CLEAN (A2))
How to remove non-breaking spaces in Excel
=TRIM (SUBSTITUTE (A2, CHAR (160), " "))
=TRIM (CLEAN ( (SUBSTITUTE (A2,CHAR (160)," "))))
How to delete a specific non-printing character
=TRIM (SUBSTITUTE (SUBSTITUTE (A2, CHAR (127), " "), CHAR (160), " ")))
How to remove all spaces in Excel
=SUBSTITUTE (A2, CHAR (32), "")
=SUBSTITUTE (A2," ","")
How to count spaces in Excel
=LEN (A2)-LEN (SUBSTITUTE (A2," ",""))
=LEN (A2)-LEN (TRIM (A2))
Formula-free way to remove spaces and clean data
You may also be interested in
 =LEN (A2)-LEN (SUBSTITUTE (A2," ",""))
To find out how many extra spaces are in the cell, get the text length without extra spaces, and then subtract it from the total string length: =LEN (A2)-LEN (TRIM (A2))
The following screenshot demonstrates both formulas in action: Now that you know how many spaces each cell contains, you can safely delete extra spaces using the TRIM formula. Formula-free way to remove spaces and clean data
As you already know, many extra spaces and other unwelcome characters can lurk unnoticed in your sheets, especially if you import your data from external sources. You also know how to delete spaces in Excel with a formula. Of course, learning a handful of formulas is a good exercise to sharpen your skills, but it might be time-consuming. Excel users who value their time and appreciate convenience can take advantage of the Text Tools included with our Ultimate Suite for Excel. One of these handy tools allows removing spaces and non-printing characters in a button click. Once installed, Ultimate Suite adds several useful buttons to your Excel ribbon such as Trim Spaces, Remove Characters, Convert Text, Clear Formatting, and a few more. Whenever you want to remove blank spaces in your Excel sheets, perform these 4 quick steps:

=LEN (A2)-LEN (SUBSTITUTE (A2," ",""))
To find out how many extra spaces are in the cell, get the text length without extra spaces, and then subtract it from the total string length: =LEN (A2)-LEN (TRIM (A2))
The following screenshot demonstrates both formulas in action: Now that you know how many spaces each cell contains, you can safely delete extra spaces using the TRIM formula. Formula-free way to remove spaces and clean data
As you already know, many extra spaces and other unwelcome characters can lurk unnoticed in your sheets, especially if you import your data from external sources. You also know how to delete spaces in Excel with a formula. Of course, learning a handful of formulas is a good exercise to sharpen your skills, but it might be time-consuming. Excel users who value their time and appreciate convenience can take advantage of the Text Tools included with our Ultimate Suite for Excel. One of these handy tools allows removing spaces and non-printing characters in a button click. Once installed, Ultimate Suite adds several useful buttons to your Excel ribbon such as Trim Spaces, Remove Characters, Convert Text, Clear Formatting, and a few more. Whenever you want to remove blank spaces in your Excel sheets, perform these 4 quick steps:

How to remove blank spaces in Excel - leading, trailing, non-breaking How to remove spaces in Excel - leading, trailing, non-breaking
How to remove spaces in Excel - leading, trailing, non-breaking
How to remove blank spaces in Excel - leading, trailing, between words
=TRIM (A2)
How to delete line breaks and nonprinting characters
=TRIM (CLEAN (A2))
How to remove non-breaking spaces in Excel
=TRIM (SUBSTITUTE (A2, CHAR (160), " "))
=TRIM (CLEAN ( (SUBSTITUTE (A2,CHAR (160)," "))))
How to delete a specific non-printing character
=TRIM (SUBSTITUTE (SUBSTITUTE (A2, CHAR (127), " "), CHAR (160), " ")))
How to remove all spaces in Excel
=SUBSTITUTE (A2, CHAR (32), "")
=SUBSTITUTE (A2," ","")
How to count spaces in Excel
=LEN (A2)-LEN (SUBSTITUTE (A2," ",""))
=LEN (A2)-LEN (TRIM (A2))
Formula-free way to remove spaces and clean data
You may also be interested in
 How to trim leading spaces in Excel (Left Trim)
How to delete line breaks and nonprinting characters
When you import data from external sources, it's not only extra spaces that come along, but also various non-printing characters like carriage return, line feed, vertical or horizontal tab, etc. The TRIM function can get rid of white spaces, but it cannot eliminate non-printing characters. Technically, Excel TRIM is designed to only delete value 32 in the 7-bit ASCII system, which is the space character. To remove spaces and non-printing characters in a string, use TRIM in combination with the CLEAN function. As its names suggests, CLEAN is purposed for cleaning data, and it can delete any and all of the first 32 non-printing characters in the in the 7-bit ASCII set (values 0 through 31) including line break (value 10). Assuming the data to be cleaned is in cell A2, the formula is as follows: =TRIM (CLEAN (A2))
If the Trim/Clean formula joins the contents of multiple lines without spaces, you can fix it by using one of these techniques: Utilize the "Replace All" feature of Excel: in the "Find what" box, input a carriage return by pressing the Ctrl+J shortcut; and in the "Replace with" box, type a space.

How to trim leading spaces in Excel (Left Trim)
How to delete line breaks and nonprinting characters
When you import data from external sources, it's not only extra spaces that come along, but also various non-printing characters like carriage return, line feed, vertical or horizontal tab, etc. The TRIM function can get rid of white spaces, but it cannot eliminate non-printing characters. Technically, Excel TRIM is designed to only delete value 32 in the 7-bit ASCII system, which is the space character. To remove spaces and non-printing characters in a string, use TRIM in combination with the CLEAN function. As its names suggests, CLEAN is purposed for cleaning data, and it can delete any and all of the first 32 non-printing characters in the in the 7-bit ASCII set (values 0 through 31) including line break (value 10). Assuming the data to be cleaned is in cell A2, the formula is as follows: =TRIM (CLEAN (A2))
If the Trim/Clean formula joins the contents of multiple lines without spaces, you can fix it by using one of these techniques: Utilize the "Replace All" feature of Excel: in the "Find what" box, input a carriage return by pressing the Ctrl+J shortcut; and in the "Replace with" box, type a space.

How to remove leading and trailing spaces in Excel cells? How to remove leading and trailing spaces in Excel cells?
How to remove leading and trailing spaces in Excel cells?
Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove extra spaces from strings
=TRIM (B2)
Tip:
Remove all excess spaces including non-printing characters and non-breaking space
=TRIM (CLEAN (SUBSTITUTE (B2,CHAR (160)," ")))
Note:
Method B: Remove leading spaces from strings with the VBA code (5 steps)
1. Press Alt + F11 key to enable Microsoft Visual Basic for Applications window.
VBA: Deleting leading spaces from string
Note:
Method C: Remove leading/trailing/extra/all spaces as you need with Kutools (3 steps)
Remove Leading Spaces only:
Remove Trailing Spaces only:
Remove Leading & Trailing Spaces only:
Remove All Excess Spaces:
Remove All Spaces:
Demo: Remove Spaces
Download sample file
Other Operations (Articles) Related To File Conversion
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier
 Select a cell next to the cell you want to remove extra spaces from string, type this formula
=TRIM (B2)
B2 is the cell you want to remove spaces from, See screenshot: 2. Press Enter key to get the result then drag auto fill handle over the cells you want to remove extra spaces from, all of leading spaces and trailing spaces and extra spaces have been removed. Tip: 1. You can copy and paste the formula results as value as below screenshot shown: 2. This method is quite easy if you only need to remove spaces in contiguous cells within a row or a column. However, when you need to remove leading spaces in a range with several rows and columns, you have to use the function several times. In this case, you can try method C.
Remove all excess spaces including non-printing characters and non-breaking space
If there are some non-printing characters in your string such as appeared in Excel as CHAR (160), they cannot be removed successfully with the TRIM function.

How to remove leading and trailing spaces in Excel cells?

How to remove leading and trailing spaces in Excel cells?
How to remove leading and trailing spaces in Excel cells?
Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove extra spaces from strings
=TRIM (B2)
Tip:
Remove all excess spaces including non-printing characters and non-breaking space
=TRIM (CLEAN (SUBSTITUTE (B2,CHAR (160)," ")))
Note:
Method B: Remove leading spaces from strings with the VBA code (5 steps)
1. Press Alt + F11 key to enable Microsoft Visual Basic for Applications window.
VBA: Deleting leading spaces from string
Note:
Method C: Remove leading/trailing/extra/all spaces as you need with Kutools (3 steps)
Remove Leading Spaces only:
Remove Trailing Spaces only:
Remove Leading & Trailing Spaces only:
Remove All Excess Spaces:
Remove All Spaces:
Demo: Remove Spaces
Download sample file
Other Operations (Articles) Related To File Conversion
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier

Select a cell next to the cell you want to remove extra spaces from string, type this formula
=TRIM (B2)
B2 is the cell you want to remove spaces from, See screenshot: 2. Press Enter key to get the result then drag auto fill handle over the cells you want to remove extra spaces from, all of leading spaces and trailing spaces and extra spaces have been removed. Tip: 1. You can copy and paste the formula results as value as below screenshot shown: 2. This method is quite easy if you only need to remove spaces in contiguous cells within a row or a column. However, when you need to remove leading spaces in a range with several rows and columns, you have to use the function several times. In this case, you can try method C.
Remove all excess spaces including non-printing characters and non-breaking space
If there are some non-printing characters in your string such as appeared in Excel as CHAR (160), they cannot be removed successfully with the TRIM function.

Excel TRIM function - quick way to remove extra spaces Excel TRIM function - quick way to remove extra spaces
Excel TRIM function - quick way to remove extra spaces
TRIM function - remove extra spaces in Excel
TRIM (text)
=TRIM (A1)
=TRIM (CLEAN (A1))
How to use TRIM function in Excel - formula examples
How to trim spaces in an entire column of data
How to remove leading spaces in a numeric column
=VALUE (TRIM (A2))
How to remove only leading spaces in Excel (Left Trim)
=MID (A2,FIND (MID (TRIM (A2),1,1),A2),LEN (A2))
How to count extra spaces in a cell
=LEN (A2)-LEN (TRIM (A2))
How to highlight cells with excess spaces
=LEN ($A2)>LEN (TRIM ($A2))
Excel TRIM not working
=TRIM (SUBSTITUTE (A1, CHAR (160), " "))
=TRIM (CLEAN (SUBSTITUTE (A1, CHAR (160), " ")))
Leading space: =CODE (LEFT (A1,1))
Trailing space: =CODE (RIGHT (A1,1))
=CODE (MID (A1, n, 1)))
=TRIM (SUBSTITUTE (A1, CHAR (9), " "))
Trim Spaces for Excel - remove extra spaces in a click
Available downloads
You may also be interested in
 Here's how: Select all cells with Trim formulas (B2: B8 in this example), and press Ctrl+C to copy them. Select all cells with the original data (A2: A8), and press Ctrl+Alt+V, then V. It is the paste values shortcut that applies the Paste Special > Values
Press the Enter key. Done! How to remove leading spaces in a numeric column
As you have just seen, the Excel TRIM function removed all extra spaces from a column of text data without a hitch. But what if your data is numbers, not text? At first sight, it may seem that the TRIM function has done its job. Upon a closer look, however, you will notice that the trimmed values do not behave like numbers.

Here's how: Select all cells with Trim formulas (B2: B8 in this example), and press Ctrl+C to copy them. Select all cells with the original data (A2: A8), and press Ctrl+Alt+V, then V. It is the paste values shortcut that applies the Paste Special > Values
Press the Enter key. Done! How to remove leading spaces in a numeric column
As you have just seen, the Excel TRIM function removed all extra spaces from a column of text data without a hitch. But what if your data is numbers, not text? At first sight, it may seem that the TRIM function has done its job. Upon a closer look, however, you will notice that the trimmed values do not behave like numbers.

Remove Extra Spaces from Excel Data | Pryor Learning Solutions Remove Extra Spaces from Excel Data
Remove Extra Spaces from Excel Data
Use the Trim Function
Use a Formula to Remove All Spaces
Bonus Hint!
Tepring Crocker
 Images were taken using Excel 2013 on the Windows 7 OS. Option 1
Use the Trim Function
The TRIM function removes all spaces from text except a single space between words. Use this function when you have text data that contains hidden spaces in the cell. In our example, you’ll see that there are multiple “Joe Smiths” in our data. At a glance, several of them even look the same. However, the # of Characters column reveals that there are hidden spaces buried in the text. Step 1
To use the TRIM function, you will need to create a temporary, or helper, column for the corrected data at the end of your spreadsheet. For the purposes of this demonstration, we’ve called the column “Trim.” To follow using our example above, download Excel Remove Spaces Formula Template
Step 2
Click in the first cell of the Trim column. On the Formulas tab, click the Text dropdown menu in the Functions group and select TRIM.

Images were taken using Excel 2013 on the Windows 7 OS. Option 1
Use the Trim Function
The TRIM function removes all spaces from text except a single space between words. Use this function when you have text data that contains hidden spaces in the cell. In our example, you’ll see that there are multiple “Joe Smiths” in our data. At a glance, several of them even look the same. However, the # of Characters column reveals that there are hidden spaces buried in the text. Step 1
To use the TRIM function, you will need to create a temporary, or helper, column for the corrected data at the end of your spreadsheet. For the purposes of this demonstration, we’ve called the column “Trim.” To follow using our example above, download Excel Remove Spaces Formula Template
Step 2
Click in the first cell of the Trim column. On the Formulas tab, click the Text dropdown menu in the Functions group and select TRIM.

Remove extra spaces in Excel 2016 - 2007 with Ultimate Suite Remove extra spaces in Excel
Remove extra spaces in Excel
Before you start
How to trim spaces in the range
 If you pick Trim leading/trailing spaces, the spaces before and after cell values will be deleted. By ticking Trim spaces between words to 1, you'll have extra spaces between words within a cell removed. The Trim ' ' option means that non-breaking spaces that look like   in your worksheet will be deleted from the selected range. Tip. You can run any of these options right away by clicking the down arrow below the add-in's icon and picking the necessary option from the drop-down menu: We always recommend selecting the Back up the worksheet option to keep your original table intact. Click the Trim button to remove all extra spaces in one click. Change Case in Excel
Add Text in Excel
Extract text and numbers
Remove unwanted characters
Convert text
Split text by characters, mask, strings
Split names: first name, middle name, last name, salutation, name suffix

If you pick Trim leading/trailing spaces, the spaces before and after cell values will be deleted. By ticking Trim spaces between words to 1, you'll have extra spaces between words within a cell removed. The Trim ' ' option means that non-breaking spaces that look like   in your worksheet will be deleted from the selected range. Tip. You can run any of these options right away by clicking the down arrow below the add-in's icon and picking the necessary option from the drop-down menu: We always recommend selecting the Back up the worksheet option to keep your original table intact. Click the Trim button to remove all extra spaces in one click. Change Case in Excel
Add Text in Excel
Extract text and numbers
Remove unwanted characters
Convert text
Split text by characters, mask, strings
Split names: first name, middle name, last name, salutation, name suffix

3 ways to remove spaces between words / numbers in Excel cells 3 ways to remove spaces between words / numbers in Excel cells
3 ways to remove spaces between words / numbers in Excel cells
Trim blanks between words to 1, remove trailing / leading spaces
Use the Trim formula to remove extra spaces
Using Find & Replace to remove extra spaces between words
3 clicks to neat data with Trim Spaces tool
Remove all spaces between numbers
Using formula to remove all spaces
Video: how to remove spaces in Excel
You may also be interested in
 All spaces are removed. Using formula to remove all spaces
You may need to delete all blanks, like in a formula chain. To do this, you can create a helper column and enter the formula: =SUBSTITUTE (A1," ","")
Here A1 is the first cell of the column with numbers or words where all spaces must be deleted. Then follow the steps from the part using formula to remove extra spaces between words to 1
Video: how to remove spaces in Excel
You may also be interested in
Excel TRIM function - quick way to remove extra spaces
How to use LEN function in Excel to count characters in a cell
How to remove all blank rows in Excel

All spaces are removed. Using formula to remove all spaces
You may need to delete all blanks, like in a formula chain. To do this, you can create a helper column and enter the formula: =SUBSTITUTE (A1," ","")
Here A1 is the first cell of the column with numbers or words where all spaces must be deleted. Then follow the steps from the part using formula to remove extra spaces between words to 1
Video: how to remove spaces in Excel
You may also be interested in
Excel TRIM function - quick way to remove extra spaces
How to use LEN function in Excel to count characters in a cell
How to remove all blank rows in Excel

Replicate Excel's TRIM Function In Power Query | How To Excel Replicate Excel’s TRIM Function In Power Query
Replicate Excel’s TRIM Function In Power Query
Table of Contents
The Problem
Video Tutorial
M Code For The Query Function
Create A Blank Query
Add M Code To The Advanced Editor
Using The Query Function
Conclusions
 Cancel
Confirm
More videos
More videos
Switch camera
Share
Include playlist
An error occurred while retrieving sharing information. Please try again later. Watch on
0:00
0:00
0:00 / 5:54
Live
•
M Code For The Query Function
let ExcelTrim = (TextToTrim) => let ReplacedText = Text. Replace (TextToTrim, " ", " "), Result = if not (Text. Contains (ReplacedText, " ")) then ReplacedText else @ExcelTrim (ReplacedText) in Text. Trim (Result) in ExcelTrim
This function takes a string of text and replaces double spaces with single spaces and repeats the process recursively until it doesn’t find any more double spaces. Then it applies the Text. Trim function to take care of any leading or trailing space characters. Creating a recursive function solves the problem of manually applying repeated Replace Values steps to remove double spaces and is a much more elegant and re-usable solution. Create A Blank Query
The first step to creating a query function is to create a new blank query.

Replicate Excel's TRIM Function In Power Query | How To Excel

Replicate Excel’s TRIM Function In Power Query
Replicate Excel’s TRIM Function In Power Query
Table of Contents
The Problem
Video Tutorial
M Code For The Query Function
Create A Blank Query
Add M Code To The Advanced Editor
Using The Query Function
Conclusions

Cancel
Confirm
More videos
More videos
Switch camera
Share
Include playlist
An error occurred while retrieving sharing information. Please try again later. Watch on
0:00
0:00
0:00 / 5:54
Live
•
M Code For The Query Function
let ExcelTrim = (TextToTrim) => let ReplacedText = Text. Replace (TextToTrim, " ", " "), Result = if not (Text. Contains (ReplacedText, " ")) then ReplacedText else @ExcelTrim (ReplacedText) in Text. Trim (Result) in ExcelTrim
This function takes a string of text and replaces double spaces with single spaces and repeats the process recursively until it doesn’t find any more double spaces. Then it applies the Text. Trim function to take care of any leading or trailing space characters. Creating a recursive function solves the problem of manually applying repeated Replace Values steps to remove double spaces and is a much more elegant and re-usable solution. Create A Blank Query
The first step to creating a query function is to create a new blank query.

Excel Remove Trailing Spaces and Leading Spaces How to Remove Leading and Trailing Spaces in Excel
How to Remove Leading and Trailing Spaces in Excel
So, it is extremely important to Excel remove trailing spaces!
TRIM Function to Remove Extra Spaces
=TRIM (
=TRIM (B7)
Substitute Function to Remove Non-Breaking Spaces
=SUBSTITUTE (
=SUBSTITUTE (C9
=SUBSTITUTE (C9,CHAR (160),
=SUBSTITUTE (C9,CHAR (160),” “)
=TRIM (SUBSTITUTE (C9, CHAR (160), ” “))
Find & Replace to remove all spaces
Conclusion
Excellent
Doing a lesson a day or more is a great…
Excellent course that are easy to flow…
An excellent website
Everything that begins well ends well.
Highly recommend
Very clear instruction video’s
My Wonderful Excel Learning Experience
This course is so easy to follow along!
Cool few minutes approach
It has been over a decade since I've had an Excel refresher, Much Needed !!
Best decision since my marriage! :)
Very Effective Training
well presented
Good teaching and it's very visual
My Excel Online Academy Beginner Course
If you like this Excel tip, please share it
email
Pinterest
Facebook
Twitter
Linkedin
About The Author
 Enter the TRIM formula in cell C7. =TRIM (
STEP 2: Enter the argument required for this formula – text from which you want extra spaces to be removed. =TRIM (B7)
The spaces get removed with no issues: STEP 3: Now, copy-paste the formula below to the cell range C7: C10. That’s it! All the unwanted spaces are gone. It is quite easy to Excel remove trailing spaces and leading spaces using the Trim function.

Excel Remove Trailing Spaces and Leading Spaces

How to Remove Leading and Trailing Spaces in Excel
How to Remove Leading and Trailing Spaces in Excel
So, it is extremely important to Excel remove trailing spaces!
TRIM Function to Remove Extra Spaces
=TRIM (
=TRIM (B7)
Substitute Function to Remove Non-Breaking Spaces
=SUBSTITUTE (
=SUBSTITUTE (C9
=SUBSTITUTE (C9,CHAR (160),
=SUBSTITUTE (C9,CHAR (160),” “)
=TRIM (SUBSTITUTE (C9, CHAR (160), ” “))
Find & Replace to remove all spaces
Conclusion
Excellent
Doing a lesson a day or more is a great…
Excellent course that are easy to flow…
An excellent website
Everything that begins well ends well.
Highly recommend
Very clear instruction video’s
My Wonderful Excel Learning Experience
This course is so easy to follow along!
Cool few minutes approach
It has been over a decade since I've had an Excel refresher, Much Needed !!
Best decision since my marriage! :)
Very Effective Training
well presented
Good teaching and it's very visual
My Excel Online Academy Beginner Course
If you like this Excel tip, please share it
email
Pinterest
Facebook
Twitter
Linkedin
About The Author

Enter the TRIM formula in cell C7. =TRIM (
STEP 2: Enter the argument required for this formula – text from which you want extra spaces to be removed. =TRIM (B7)
The spaces get removed with no issues: STEP 3: Now, copy-paste the formula below to the cell range C7: C10. That’s it! All the unwanted spaces are gone. It is quite easy to Excel remove trailing spaces and leading spaces using the Trim function.

Data Cleanup Tips for Microsoft Excel - Office Articles Data Cleanup Tips for Microsoft Excel
Data Cleanup Tips for Microsoft Excel
Data Isn't Recognized Properly
Clean Up Extra Spaces or Characters Using Find and Replace
Use the TRIM Function to Remove Spaces
Use the CLEAN Function to Remove Non-Printing Characters
Vertical to Horizontal Addresses
Sorting as a Data Cleanup Tool
 Find what: Type a left parenthesis (or a right parenthesis or a hyphen or a period)
Replace with: Leave this empty! Replace all
Use the TRIM Function to Remove Spaces
The TRIM function removes spaces to the left and right of your data, but not spaces between data within a single cell. Insert a blank column to the right of the column you want to trim. For our purposes, we'll use column A as the column we want to trim, and B2 is where we'll put our first formula. =TRIM (A2)
Copy the formula down using the fill handle. In order to work with the trimmed text, highlight the cells, hit Edit Copy, then hit Edit Paste Special, Values, OK. That removes the underlying formulas. You can now move your column heading over to your new column of trimmed data, and delete the original column.

Data Cleanup Tips for Microsoft Excel - Office Articles

Data Cleanup Tips for Microsoft Excel
Data Cleanup Tips for Microsoft Excel
Data Isn't Recognized Properly
Clean Up Extra Spaces or Characters Using Find and Replace
Use the TRIM Function to Remove Spaces
Use the CLEAN Function to Remove Non-Printing Characters
Vertical to Horizontal Addresses
Sorting as a Data Cleanup Tool

Find what: Type a left parenthesis (or a right parenthesis or a hyphen or a period)
Replace with: Leave this empty! Replace all
Use the TRIM Function to Remove Spaces
The TRIM function removes spaces to the left and right of your data, but not spaces between data within a single cell. Insert a blank column to the right of the column you want to trim. For our purposes, we'll use column A as the column we want to trim, and B2 is where we'll put our first formula. =TRIM (A2)
Copy the formula down using the fill handle. In order to work with the trimmed text, highlight the cells, hit Edit Copy, then hit Edit Paste Special, Values, OK. That removes the underlying formulas. You can now move your column heading over to your new column of trimmed data, and delete the original column.

Easily remove leading, trailing, extra or all spaces in cells Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Several Clicks To Remove Unneeded Spaces From Cells
Remove only leading spaces from cells
Use MID function to remove leading spaces only
=MID (B3,FIND (MID (TRIM (B3),1,1),B3),LEN (B3))
Use VBA code to remove leading spaces only
Remove only trailing spaces from cells
Remove all spaces from cells
Use SUBSTITUTE function to remove all spaces from cells
=SUBSTITUTE (B3," ","")
Use Find & Replace function to remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with the Kutools
Other practical cases related to Excel spaces
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier
 Remove extra spaces including leading, trailing and excess in-between spaces from cells
Remove only leading spaces from cells
Remove only trailing spaces from cells
Remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with an amazing feature
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Supposing you have a column list of cells containing leading, trailing, and excess in-between spaces. For removing all these extra spaces from cells, the TRIM function can help. =TRIM (TEXT)
Select a blank cell, enter =TRIM (B3) into it and press the Enter key. And then drag its Fill Handle down to apply the formula to other cells. See screenshot: Note: B3 is the cell containing the text from which you want spaces to be removed. Now all extra spaces including leading, trailing, and excess in-between spaces are removed from the specified cells. Note: This operation needs to be done in a new column.

Easily remove leading, trailing, extra or all spaces in cells

Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Several Clicks To Remove Unneeded Spaces From Cells
Remove only leading spaces from cells
Use MID function to remove leading spaces only
=MID (B3,FIND (MID (TRIM (B3),1,1),B3),LEN (B3))
Use VBA code to remove leading spaces only
Remove only trailing spaces from cells
Remove all spaces from cells
Use SUBSTITUTE function to remove all spaces from cells
=SUBSTITUTE (B3," ","")
Use Find & Replace function to remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with the Kutools
Other practical cases related to Excel spaces
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier

Remove extra spaces including leading, trailing and excess in-between spaces from cells
Remove only leading spaces from cells
Remove only trailing spaces from cells
Remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with an amazing feature
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Supposing you have a column list of cells containing leading, trailing, and excess in-between spaces. For removing all these extra spaces from cells, the TRIM function can help. =TRIM (TEXT)
Select a blank cell, enter =TRIM (B3) into it and press the Enter key. And then drag its Fill Handle down to apply the formula to other cells. See screenshot: Note: B3 is the cell containing the text from which you want spaces to be removed. Now all extra spaces including leading, trailing, and excess in-between spaces are removed from the specified cells. Note: This operation needs to be done in a new column.

Remove Extra Spaces from Excel Data | Pryor Learning Solutions Remove Extra Spaces from Excel Data
Remove Extra Spaces from Excel Data
Use the Trim Function
Use a Formula to Remove All Spaces
Bonus Hint!
Tepring Crocker
 Step 5
Now you just need to replace your original data with your clean data. To do this, select all of the cells in the Trim column, then hit CTRL+C to copy the cells to the clipboard. Then, select the first cell in the Name column and right-click. Select Paste Values under the Paste Options heading. Now you can Delete the Trim helper column and your Name column is clean. Option 2
Use a Formula to Remove All Spaces
If you need to prepare your data for import into a database (such as MS Access) or have a combination of number and text data that simply needs ALL spaces removed, you can use a formula instead of the TRIM function to remove ALL blanks in a cell. Step 1
Create a temporary, or helper, column for the corrected data at the end of your spreadsheet like you did for the TRIM function. In this example the column is called No Spaces. Step 2
Click in the first cell of the Trim column. On the Formulas tab, click the Text dropdown menu in the Functions group and select SUBSTITUTE.

Step 5
Now you just need to replace your original data with your clean data. To do this, select all of the cells in the Trim column, then hit CTRL+C to copy the cells to the clipboard. Then, select the first cell in the Name column and right-click. Select Paste Values under the Paste Options heading. Now you can Delete the Trim helper column and your Name column is clean. Option 2
Use a Formula to Remove All Spaces
If you need to prepare your data for import into a database (such as MS Access) or have a combination of number and text data that simply needs ALL spaces removed, you can use a formula instead of the TRIM function to remove ALL blanks in a cell. Step 1
Create a temporary, or helper, column for the corrected data at the end of your spreadsheet like you did for the TRIM function. In this example the column is called No Spaces. Step 2
Click in the first cell of the Trim column. On the Formulas tab, click the Text dropdown menu in the Functions group and select SUBSTITUTE.

4 Ways to Remove Unwanted Space Characters | How To Excel 4 Ways to Remove Unwanted Space Characters
4 Ways to Remove Unwanted Space Characters
Table of Contents
Our Example Data for the Post
Removing Extra Spaces with the TRIM Function
Removing Extra Spaces Between Words with Find and Replace
Removing Extra Spaces with Power Query
Removing Extra Spaces Between Words With VBA
Conclusions
Subscribe
Consulting
Excel Insights
Excel Functions eBook
Microsoft MVP
Categories
Advertisement
 Removing Extra Spaces Between Words With VBA
VBA also has a trim function built in. Sub TrimSpaces ()  Dim rng As Range Dim cell As Range Dim TempCell As String  Set rng = Selection  For Each cell In rng  TempCell = cell. Value  TempCell = Trim (TempCell)  cell. Value = TempCell Next cell  End Sub
The code above will loop through each cell in a selected range and apply the VBA Trim function to the value inside the cell. Similar to the power query Trim transformation, it will only remove the spaces at the start and end of any text. Conclusions
There are lots of methods available for removing any extra spaces found in our data. We took a look at formulas, find and replace, power query and VBA. In my opinion, the simple TRIM worksheet function is the easiest and most effective way. Previous Sending Emails from Excel with Microsoft Flow
Next Importing and Exporting Data from SharePoint and Excel
Subscribe
Consulting
Excel Insights
Excel Functions eBook
Microsoft MVP
Categories
Categories Select Category Charts DAX Formulas Functions Date and Time Information Logical Lookup and Reference Math Text General Get & Transform Microsoft Flow Pivot Tables Power Automate Power BI Power Pivot Power Query PowerApps Resources Shortcuts Statistics Teams Templates Tips & Tricks Tutorials VBA
Advertisement

4 Ways to Remove Unwanted Space Characters | How To Excel

4 Ways to Remove Unwanted Space Characters
4 Ways to Remove Unwanted Space Characters
Table of Contents
Our Example Data for the Post
Removing Extra Spaces with the TRIM Function
Removing Extra Spaces Between Words with Find and Replace
Removing Extra Spaces with Power Query
Removing Extra Spaces Between Words With VBA
Conclusions
Subscribe
Consulting
Excel Insights
Excel Functions eBook
Microsoft MVP
Categories
Advertisement

Removing Extra Spaces Between Words With VBA
VBA also has a trim function built in. Sub TrimSpaces ()  Dim rng As Range Dim cell As Range Dim TempCell As String  Set rng = Selection  For Each cell In rng  TempCell = cell. Value  TempCell = Trim (TempCell)  cell. Value = TempCell Next cell  End Sub
The code above will loop through each cell in a selected range and apply the VBA Trim function to the value inside the cell. Similar to the power query Trim transformation, it will only remove the spaces at the start and end of any text. Conclusions
There are lots of methods available for removing any extra spaces found in our data. We took a look at formulas, find and replace, power query and VBA. In my opinion, the simple TRIM worksheet function is the easiest and most effective way. Previous Sending Emails from Excel with Microsoft Flow
Next Importing and Exporting Data from SharePoint and Excel
Subscribe
Consulting
Excel Insights
Excel Functions eBook
Microsoft MVP
Categories
Categories Select Category Charts DAX Formulas Functions Date and Time Information Logical Lookup and Reference Math Text General Get & Transform Microsoft Flow Pivot Tables Power Automate Power BI Power Pivot Power Query PowerApps Resources Shortcuts Statistics Teams Templates Tips & Tricks Tutorials VBA
Advertisement

Removing Spaces in Excel 2010 Made Easy
 Removing Spaces in Excel 2010 Made Easy
Menu
About
Contact
Privacy Policy
Submit For Review
Template Gallery
Excel 2016 Udemy Course
Skip to primary navigation
Skip to main content
Skip to primary sidebar
TheAppTimes
App Reviews, Tutorials, & Gadget News Hub
Gadgets
How To
Mobile Apps
Software and Web Apps
Buying Guides
Shop
Show Search
Search this website
Hide Search
Home » How To » How to Remove Spaces in Excel 2010 (Leading, Trailing or All)
How to Remove Spaces in Excel 2010 (Leading, Trailing or All)
February 21, 2011
If you are in the habit of copying content from other spreadsheet or from a website to your Excel database, you might often be faced with the situation where the copied content display additional spaces either the beginning or end of a string. You may also find extra spaces within a string. In this Excel 2010 tutorial, you will learn how to remove spaces in excel (leading, trailing, or all ) under different circumstances. How to Remove Spaces in Excel Using TRIM Function (Leading & Trailing Spaces)
1. Place the cursor in the cell where you want the result to appear. 2. Type =TRIM (Cell Reference) and press Enter. The result is that text will now remove all leading and trailing spaces, as well as extra spaces in the middle of a string. There may be times when the TRIM function does not work. For instance, when data is copied from a HTM page, the spaces in the cells are nonbreaking spaces with a decimal character code of 160 rather than a ASCII space decimal character code of 32.

Removing Spaces in Excel 2010 Made Easy

Learn How to Remove Extra Spaces From Excel Using TRIM How to Remove Extra Spaces From Excel
How to Remove Extra Spaces From Excel
An easier way to clean up your Excel spreadsheet
How the TRIM Function Works
Using the TRIM Function
Removing Extra Spaces From an Entire Column
Using the Search and Replace Short Cut Key
Was this page helpful?
 Learn How to Remove Extra Spaces From Excel Using TRIM
Software & Apps MS Office
How to Remove Extra Spaces From Excel
An easier way to clean up your Excel spreadsheet
by
Ted French
Writer
Former Lifewire writer Ted French is a Microsoft Certified Professional who teaches and writes about spreadsheets and spreadsheet programs. our editorial process
Ted French
Updated on October 13, 2019
Tweet
Share
Email
MS Office
Excel
Word
Powerpoint
Outlook
When you import or copy text data into an Excel worksheet , you often end up with extra spaces. Using Excel's TRIM function, or a shortcut key to trigger Excel's search and replace feature, you can easily remove those unnecessary spacing. In the case of the TRIM function, you'll need to create a new column in the worksheet for your clean text. Then you can copy and paste the clean text back into the original column. A much faster trick is to use the CTRL + H shortcut key to search the problem column and quickly remove all of the extra spaces. How the TRIM Function Works
The syntax for the TRIM function is: =TRIM (Text)
The Text, in this case, refers to the data with the extraneous spacing. This argument can be: The actual text enclosed in quotation marks
A cell reference to the location of the text data in the worksheet
Many people think that the TRIM function removes only the spaces at the beginning and the end of the text.

Learn How to Remove Extra Spaces From Excel Using TRIM
Software & Apps MS Office
How to Remove Extra Spaces From Excel
An easier way to clean up your Excel spreadsheet
by
Ted French
Writer
Former Lifewire writer Ted French is a Microsoft Certified Professional who teaches and writes about spreadsheets and spreadsheet programs. our editorial process
Ted French
Updated on October 13, 2019
Tweet
Share
Email
MS Office
Excel
Word
Powerpoint
Outlook
When you import or copy text data into an Excel worksheet , you often end up with extra spaces. Using Excel's TRIM function, or a shortcut key to trigger Excel's search and replace feature, you can easily remove those unnecessary spacing. In the case of the TRIM function, you'll need to create a new column in the worksheet for your clean text. Then you can copy and paste the clean text back into the original column. A much faster trick is to use the CTRL + H shortcut key to search the problem column and quickly remove all of the extra spaces. How the TRIM Function Works
The syntax for the TRIM function is: =TRIM (Text)
The Text, in this case, refers to the data with the extraneous spacing. This argument can be: The actual text enclosed in quotation marks
A cell reference to the location of the text data in the worksheet
Many people think that the TRIM function removes only the spaces at the beginning and the end of the text.

How to Remove Whitespace From a String in Excel | Small Business - Chron.com How to Remove Whitespace From a String in Excel
How to Remove Whitespace From a String in Excel
1
2
3
 How to Remove Whitespace From a String in Excel | Small Business - Chron.com
How to Remove Whitespace From a String in Excel
Small Business
|
Accounting & Bookkeeping
|
Excel
By C. Taylor
Rarely is formatting perfect when you copy data from external sources into Microsoft Excel. As an example, you might copy business data from an online database only to find unwanted whitespace within the text strings in Excel. The term “whitespace” in Web design and some programming languages refers to extra spaces embedded within data, such as those entered using the space bar on a keyboard or by inserting non-breaking spaces into Web pages using the HTML code "&nbsp." It’s easy to remove all whitespace from a string, but you’ll typically want to keep a single space between words. Excel's Trim function will remove all but one space between words; however, it cannot remove non-breaking spaces – this requires a combination Excel's Substitute and Trim functions. 1
Open your spreadsheet in Excel and locate the cells containing the whitespace that needs to be removed. 2
Use the Trim function to remove whitespace created from normal spaces. The Trim function requires a single reference to operate. For example, entering "=TRIM (A1)" without quotes will strip all but single spaces between words from the string " this is a test " in cell A1, leaving "this is a test".

How to Remove Whitespace From a String in Excel | Small Business - Chron.com
How to Remove Whitespace From a String in Excel
Small Business
|
Accounting & Bookkeeping
|
Excel
By C. Taylor
Rarely is formatting perfect when you copy data from external sources into Microsoft Excel. As an example, you might copy business data from an online database only to find unwanted whitespace within the text strings in Excel. The term “whitespace” in Web design and some programming languages refers to extra spaces embedded within data, such as those entered using the space bar on a keyboard or by inserting non-breaking spaces into Web pages using the HTML code "&nbsp." It’s easy to remove all whitespace from a string, but you’ll typically want to keep a single space between words. Excel's Trim function will remove all but one space between words; however, it cannot remove non-breaking spaces – this requires a combination Excel's Substitute and Trim functions. 1
Open your spreadsheet in Excel and locate the cells containing the whitespace that needs to be removed. 2
Use the Trim function to remove whitespace created from normal spaces. The Trim function requires a single reference to operate. For example, entering "=TRIM (A1)" without quotes will strip all but single spaces between words from the string " this is a test " in cell A1, leaving "this is a test".

How to remove leading and trailing spaces in Excel cells? How to remove leading and trailing spaces in Excel cells?
How to remove leading and trailing spaces in Excel cells?
Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove extra spaces from strings
=TRIM (B2)
Tip:
Remove all excess spaces including non-printing characters and non-breaking space
=TRIM (CLEAN (SUBSTITUTE (B2,CHAR (160)," ")))
Note:
Method B: Remove leading spaces from strings with the VBA code (5 steps)
1. Press Alt + F11 key to enable Microsoft Visual Basic for Applications window.
VBA: Deleting leading spaces from string
Note:
Method C: Remove leading/trailing/extra/all spaces as you need with Kutools (3 steps)
Remove Leading Spaces only:
Remove Trailing Spaces only:
Remove Leading & Trailing Spaces only:
Remove All Excess Spaces:
Remove All Spaces:
Demo: Remove Spaces
Download sample file
Other Operations (Articles) Related To File Conversion
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier
 How to remove leading and trailing spaces in Excel cells? >> QUICK NAVIGATION
Trim function
VBA code
Kutools
Sample File
Relative Articles
How to remove leading and trailing spaces in Excel cells? Sometimes, when you copy data from other locations and pasted them at Excel worksheet, there may be some extra spaces leaving at front or the end of strings in cells. It is time-consuming to delete the spaces one by one for making data looks tidy. Here this tutorial introduces the smart and easy ways help you to quickly remove leading and trailing spaces. Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove all excess spaces including extra space, leading and trailing space
Method B: Remove leading spaces from strings with the VBA code (5 steps)
Remove only first space, need have a copy before running code
Method C: Remove leading/trailing/extra/all spaces as you need with Kutools (3 steps)
Remove leading/trailing/extra/all spaces as you need
Download sample file
This sample file contains all data this article need
Other Operations (Articles) Related To Spaces
Count space before text string Find position of nth space So on..
Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove extra spaces from strings
1.

How to remove leading and trailing spaces in Excel cells? >> QUICK NAVIGATION
Trim function
VBA code
Kutools
Sample File
Relative Articles
How to remove leading and trailing spaces in Excel cells? Sometimes, when you copy data from other locations and pasted them at Excel worksheet, there may be some extra spaces leaving at front or the end of strings in cells. It is time-consuming to delete the spaces one by one for making data looks tidy. Here this tutorial introduces the smart and easy ways help you to quickly remove leading and trailing spaces. Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove all excess spaces including extra space, leading and trailing space
Method B: Remove leading spaces from strings with the VBA code (5 steps)
Remove only first space, need have a copy before running code
Method C: Remove leading/trailing/extra/all spaces as you need with Kutools (3 steps)
Remove leading/trailing/extra/all spaces as you need
Download sample file
This sample file contains all data this article need
Other Operations (Articles) Related To Spaces
Count space before text string Find position of nth space So on..
Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove extra spaces from strings
1.

Remove Space in Excel | Top 5 Methods to Filter Data with Spaces Remove Space in Excel
Remove Space in Excel
Top 5 Methods to Filter Data with Spaces in Excel
#1 – How to Remove Space from the text in Excel Using Trim Function?
#2 – How to Remove Space Using Delimited in Text To Columns?
#3 – How to Remove Space in Excel Using Fixed Width in Text to Columns Option?
#4 – How to Remove Space Using Find & Replace Option?
#5 – How to Remove Space in Excel Using Substitute Function?
Explanation of Removing Spaces in Excel
Things to Remember
Recommended Articles
 Remove Space in Excel | Top 5 Methods to Filter Data with Spaces
Home » Excel, VBA & Power BI » Excel Resources » Remove Space in Excel
Remove Space in Excel
Article by Madhuri Thakur
Reviewed by Dheeraj Vaidya, CFA, FRM
Top 5 Methods to Filter Data with Spaces in Excel
Using Trim Function
Using Delimited in Text to Columns
Using Fixed width in Text to Columns
Using Find & Replace Option
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,
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. 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. 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 in excel also can remove spaces from a cell.

Remove Space in Excel | Top 5 Methods to Filter Data with Spaces

Remove Space in Excel
Remove Space in Excel
Top 5 Methods to Filter Data with Spaces in Excel
#1 – How to Remove Space from the text in Excel Using Trim Function?
#2 – How to Remove Space Using Delimited in Text To Columns?
#3 – How to Remove Space in Excel Using Fixed Width in Text to Columns Option?
#4 – How to Remove Space Using Find & Replace Option?
#5 – How to Remove Space in Excel Using Substitute Function?
Explanation of Removing Spaces in Excel
Things to Remember
Recommended Articles

Remove Space in Excel | Top 5 Methods to Filter Data with Spaces
Home » Excel, VBA & Power BI » Excel Resources » Remove Space in Excel
Remove Space in Excel
Article by Madhuri Thakur
Reviewed by Dheeraj Vaidya, CFA, FRM
Top 5 Methods to Filter Data with Spaces in Excel
Using Trim Function
Using Delimited in Text to Columns
Using Fixed width in Text to Columns
Using Find & Replace Option
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,
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. 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. 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 in excel also can remove spaces from a cell.

How to remove leading and trailing spaces in Excel cells? How to remove leading and trailing spaces in Excel cells?
How to remove leading and trailing spaces in Excel cells?
Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove extra spaces from strings
=TRIM (B2)
Tip:
Remove all excess spaces including non-printing characters and non-breaking space
=TRIM (CLEAN (SUBSTITUTE (B2,CHAR (160)," ")))
Note:
Method B: Remove leading spaces from strings with the VBA code (5 steps)
1. Press Alt + F11 key to enable Microsoft Visual Basic for Applications window.
VBA: Deleting leading spaces from string
Note:
Method C: Remove leading/trailing/extra/all spaces as you need with Kutools (3 steps)
Remove Leading Spaces only:
Remove Trailing Spaces only:
Remove Leading & Trailing Spaces only:
Remove All Excess Spaces:
Remove All Spaces:
Demo: Remove Spaces
Download sample file
Other Operations (Articles) Related To File Conversion
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier
 Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove all excess spaces including extra space, leading and trailing space
Method B: Remove leading spaces from strings with the VBA code (5 steps)
Remove only first space, need have a copy before running code
Method C: Remove leading/trailing/extra/all spaces as you need with Kutools (3 steps)
Remove leading/trailing/extra/all spaces as you need
Download sample file
This sample file contains all data this article need
Other Operations (Articles) Related To Spaces
Count space before text string Find position of nth space So on..
Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove extra spaces from strings
1. Select a cell next to the cell you want to remove extra spaces from string, type this formula
=TRIM (B2)
B2 is the cell you want to remove spaces from, See screenshot: 2. Press Enter key to get the result then drag auto fill handle over the cells you want to remove extra spaces from, all of leading spaces and trailing spaces and extra spaces have been removed. Tip: 1.

Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove all excess spaces including extra space, leading and trailing space
Method B: Remove leading spaces from strings with the VBA code (5 steps)
Remove only first space, need have a copy before running code
Method C: Remove leading/trailing/extra/all spaces as you need with Kutools (3 steps)
Remove leading/trailing/extra/all spaces as you need
Download sample file
This sample file contains all data this article need
Other Operations (Articles) Related To Spaces
Count space before text string Find position of nth space So on..
Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove extra spaces from strings
1. Select a cell next to the cell you want to remove extra spaces from string, type this formula
=TRIM (B2)
B2 is the cell you want to remove spaces from, See screenshot: 2. Press Enter key to get the result then drag auto fill handle over the cells you want to remove extra spaces from, all of leading spaces and trailing spaces and extra spaces have been removed. Tip: 1.

Remove Leading and Trailing Spaces - Free Excel Tutorial Remove Leading and Trailing Spaces
Remove Leading and Trailing Spaces
Method 1: Remove Leading and Trailing spaces with Excel Formula
Method 2: Remove Leading and Trailing spaces with Excel VBA macro
Related Functions
 A4, you can refer to the following two methods to achieve it. Method 1: Remove Leading and Trailing spaces with Excel Formula
To remove leading and trailing spaces from text string in Cells, you can use the TRIM function to remove extra spaces. So you can type the following formula in Cell B1, then press Enter key. = TRIM (A1)
Then select Cell B1 and drag the AutoFill Handle down to other cells that you want to remove the leading or trailing spaces. You will see that all of your leading and trailing spaces in range A1: A4 are cleaned up. Note: if the text contains non-braking spaces, this formula will not work, because the TRIM function is not able to remove non-breaking spaces. At this time, you should remove the non-breaking spaces firstly with the SUBSTITUTE function, and then use the TRIM function to remove the rest leading and trailing spaces.

Remove Leading and Trailing Spaces - Free Excel Tutorial

Remove Leading and Trailing Spaces
Remove Leading and Trailing Spaces
Method 1: Remove Leading and Trailing spaces with Excel Formula
Method 2: Remove Leading and Trailing spaces with Excel VBA macro
Related Functions

A4, you can refer to the following two methods to achieve it. Method 1: Remove Leading and Trailing spaces with Excel Formula
To remove leading and trailing spaces from text string in Cells, you can use the TRIM function to remove extra spaces. So you can type the following formula in Cell B1, then press Enter key. = TRIM (A1)
Then select Cell B1 and drag the AutoFill Handle down to other cells that you want to remove the leading or trailing spaces. You will see that all of your leading and trailing spaces in range A1: A4 are cleaned up. Note: if the text contains non-braking spaces, this formula will not work, because the TRIM function is not able to remove non-breaking spaces. At this time, you should remove the non-breaking spaces firstly with the SUBSTITUTE function, and then use the TRIM function to remove the rest leading and trailing spaces.

Easily remove leading, trailing, extra or all spaces in cells Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Several Clicks To Remove Unneeded Spaces From Cells
Remove only leading spaces from cells
Use MID function to remove leading spaces only
=MID (B3,FIND (MID (TRIM (B3),1,1),B3),LEN (B3))
Use VBA code to remove leading spaces only
Remove only trailing spaces from cells
Remove all spaces from cells
Use SUBSTITUTE function to remove all spaces from cells
=SUBSTITUTE (B3," ","")
Use Find & Replace function to remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with the Kutools
Other practical cases related to Excel spaces
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier
 Easily remove leading, trailing, extra or all spaces in cells

Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Sometimes, when data has been copied and pasted from other applications into a worksheet, something may go wrong if extra spaces unconsciously coming along with the data. For example, when adding two number cells which including leading spaces, it will return the result as 0 instead of the correct result; Or get the wrong result while comparing two cells with the same content but one of them containing leading or trailing spaces. How to remove these spaces? This tutorial will introduce several methods for you. Remove extra spaces including leading, trailing and excess in-between spaces from cells
Remove only leading spaces from cells
Remove only trailing spaces from cells
Remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with an amazing feature
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Supposing you have a column list of cells containing leading, trailing, and excess in-between spaces. For removing all these extra spaces from cells, the TRIM function can help. =TRIM (TEXT)
Select a blank cell, enter =TRIM (B3) into it and press the Enter key. And then drag its Fill Handle down to apply the formula to other cells. See screenshot:

Easily remove leading, trailing, extra or all spaces in cells

Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Sometimes, when data has been copied and pasted from other applications into a worksheet, something may go wrong if extra spaces unconsciously coming along with the data. For example, when adding two number cells which including leading spaces, it will return the result as 0 instead of the correct result; Or get the wrong result while comparing two cells with the same content but one of them containing leading or trailing spaces. How to remove these spaces? This tutorial will introduce several methods for you. Remove extra spaces including leading, trailing and excess in-between spaces from cells
Remove only leading spaces from cells
Remove only trailing spaces from cells
Remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with an amazing feature
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Supposing you have a column list of cells containing leading, trailing, and excess in-between spaces. For removing all these extra spaces from cells, the TRIM function can help. =TRIM (TEXT)
Select a blank cell, enter =TRIM (B3) into it and press the Enter key. And then drag its Fill Handle down to apply the formula to other cells. See screenshot:

How to remove leading and trailing spaces in Excel cells? How to remove leading and trailing spaces in Excel cells?
How to remove leading and trailing spaces in Excel cells?
Method A: Remove all extra spaces from strings with the TRIM function (2 steps)
Remove extra spaces from strings
=TRIM (B2)
Tip:
Remove all excess spaces including non-printing characters and non-breaking space
=TRIM (CLEAN (SUBSTITUTE (B2,CHAR (160)," ")))
Note:
Method B: Remove leading spaces from strings with the VBA code (5 steps)
1. Press Alt + F11 key to enable Microsoft Visual Basic for Applications window.
VBA: Deleting leading spaces from string
Note:
Method C: Remove leading/trailing/extra/all spaces as you need with Kutools (3 steps)
Remove Leading Spaces only:
Remove Trailing Spaces only:
Remove Leading & Trailing Spaces only:
Remove All Excess Spaces:
Remove All Spaces:
Demo: Remove Spaces
Download sample file
Other Operations (Articles) Related To File Conversion
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier
 Address, Type:=8)
For Each Rng In WorkRng
Rng. Value = VBA.LTrim (Rng. Value)
Next
End Sub
3. Press F5 key to run the code, then a KutoolsforExcel dialog pops out for selecting cells to remove leading spaces. 4. After choosing cells, click OK, now, the leading spaces in selections have been removed. Note: With this VBA code, it removes leading spaces only, and it will change original data and does not support Undo. Before you applying this VBA code, please save a copy of your data. Method C:

Address, Type:=8)
For Each Rng In WorkRng
Rng. Value = VBA.LTrim (Rng. Value)
Next
End Sub
3. Press F5 key to run the code, then a KutoolsforExcel dialog pops out for selecting cells to remove leading spaces. 4. After choosing cells, click OK, now, the leading spaces in selections have been removed. Note: With this VBA code, it removes leading spaces only, and it will change original data and does not support Undo. Before you applying this VBA code, please save a copy of your data. Method C:

Learn How to Remove Extra Spaces From Excel Using TRIM How to Remove Extra Spaces From Excel
How to Remove Extra Spaces From Excel
An easier way to clean up your Excel spreadsheet
How the TRIM Function Works
Using the TRIM Function
Removing Extra Spaces From an Entire Column
Using the Search and Replace Short Cut Key
Was this page helpful?
 Press the CTRL + H shortcut to open Excel's Search and Replace window. In the Find what field, type two spaces. In the Replace with field, type one space. Keep pressing the Replace All button until all extra spaces are gone. The benefit of using this approach is that you don't have to go through the entire copy-and-paste procedure that you need to with the TRIM function. The method you use to remove extra spaces in Excel depends on what your original data looks like, and where the spaces are. Either way, one of these two methods should work well to help you clean up that messy text in your spreadsheet. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day
Email Address
Sign up
There was an error.

Press the CTRL + H shortcut to open Excel's Search and Replace window. In the Find what field, type two spaces. In the Replace with field, type one space. Keep pressing the Replace All button until all extra spaces are gone. The benefit of using this approach is that you don't have to go through the entire copy-and-paste procedure that you need to with the TRIM function. The method you use to remove extra spaces in Excel depends on what your original data looks like, and where the spaces are. Either way, one of these two methods should work well to help you clean up that messy text in your spreadsheet. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day
Email Address
Sign up
There was an error.

Excel Text and String Functions: TRIM & CLEAN Excel Functions
Excel Functions
Excel Text and String Functions: TRIM & CLEAN
Excel Text and String Functions:
Removing spaces and nonprinting characters from text: Excel TRIM & CLEAN functions
Related Links:
TRIM Function (Worksheet)
Example:
=TRIM (" James Bond 007 ") [Formula]
CLEAN Function (Worksheet)
Example:
=CLEAN (A1) [Formula]
Use a combination of the TRIM, CLEAN and SUBSTITUTE functions
Example:
=TRIM (A1) [Formula]
=TRIM (SUBSTITUTE (A1, CHAR (160), CHAR (32))) [Formula]
Example:
=TRIM (SUBSTITUTE (A1,"/","")) [Formula]
Example:
=CLEAN (SUBSTITUTE (A1, CHAR (127), CHAR (7))) [Formula]
Example:
=CLEAN (SUBSTITUTE (A1,CHAR (128),CHAR (7))) [Formula]
Find ASCII value of Characters to be replaced
Find Visible Spaces:
Find Visible ASCII Characters:
=CODE (MID (A1,6,1)) [Formula]
Find Invisible spaces / characters:
Find All Spaces & Characters of ASCII value 127 and above, which cannot be removed by TRIM & CLEAN functions:
 Leading and trailing blank characters will result in incorrect sorting & filtering of your data; extra spaces and characters will prevent correct working of your formulas (say, when you do a vlookup), cause formatting & calculation errors, and generally impede in manipulating text/data besides appearing visibly incorrect. TRIM Function (Worksheet)
Use the excel TRIM function to remove all spaces from text leaving only single spaces between words. Trim deletes all leading & trailing spaces in a text string, and multiple spaces within words are reduced to a single space. Note that Trim removes the space character with ANSI code 32, but does not remove the non-breaking space character in the Unicode character set with decimal value 160 which is used extensively in web pages (with html entity &nbsp). Syntax: TRIM (text). Example: =TRIM (" James Bond 007 ") [Formula]
Returns the string "James Bond 007". TRIM leaves single space between words and removes leading, trailing & multiple inbetween spaces from text.

Excel Text and String Functions: TRIM & CLEAN

Excel Functions
Excel Functions
Excel Text and String Functions: TRIM & CLEAN
Excel Text and String Functions:
Removing spaces and nonprinting characters from text: Excel TRIM & CLEAN functions
Related Links:
TRIM Function (Worksheet)
Example:
=TRIM (" James Bond 007 ") [Formula]
CLEAN Function (Worksheet)
Example:
=CLEAN (A1) [Formula]
Use a combination of the TRIM, CLEAN and SUBSTITUTE functions
Example:
=TRIM (A1) [Formula]
=TRIM (SUBSTITUTE (A1, CHAR (160), CHAR (32))) [Formula]
Example:
=TRIM (SUBSTITUTE (A1,"/","")) [Formula]
Example:
=CLEAN (SUBSTITUTE (A1, CHAR (127), CHAR (7))) [Formula]
Example:
=CLEAN (SUBSTITUTE (A1,CHAR (128),CHAR (7))) [Formula]
Find ASCII value of Characters to be replaced
Find Visible Spaces:
Find Visible ASCII Characters:
=CODE (MID (A1,6,1)) [Formula]
Find Invisible spaces / characters:
Find All Spaces & Characters of ASCII value 127 and above, which cannot be removed by TRIM & CLEAN functions:

Leading and trailing blank characters will result in incorrect sorting & filtering of your data; extra spaces and characters will prevent correct working of your formulas (say, when you do a vlookup), cause formatting & calculation errors, and generally impede in manipulating text/data besides appearing visibly incorrect. TRIM Function (Worksheet)
Use the excel TRIM function to remove all spaces from text leaving only single spaces between words. Trim deletes all leading & trailing spaces in a text string, and multiple spaces within words are reduced to a single space. Note that Trim removes the space character with ANSI code 32, but does not remove the non-breaking space character in the Unicode character set with decimal value 160 which is used extensively in web pages (with html entity &nbsp). Syntax: TRIM (text). Example: =TRIM (" James Bond 007 ") [Formula]
Returns the string "James Bond 007". TRIM leaves single space between words and removes leading, trailing & multiple inbetween spaces from text.

4 Ways to Remove Unwanted Space Characters | How To Excel 4 Ways to Remove Unwanted Space Characters
4 Ways to Remove Unwanted Space Characters
Table of Contents
Our Example Data for the Post
Removing Extra Spaces with the TRIM Function
Removing Extra Spaces Between Words with Find and Replace
Removing Extra Spaces with Power Query
Removing Extra Spaces Between Words With VBA
Conclusions
Subscribe
Consulting
Excel Insights
Excel Functions eBook
Microsoft MVP
Categories
Advertisement
 Like the find and replace method, we will need to add two spaces as the Value To Find and a single space as the Replace With value. We can then press the OK button to add this transformation. We need to repeat this step until all the extra spaces have been removed from our data. To get the cleaned data back into Excel, we need to close and load the data. We can go to the Home tab in the power query editor ➜ press Close & Load ➜ choose Close & Load To ➜ choose a Table and select the location to load the table. Removing Extra Spaces Between Words With VBA
VBA also has a trim function built in. Sub TrimSpaces ()  Dim rng As Range Dim cell As Range Dim TempCell As String  Set rng = Selection  For Each cell In rng  TempCell = cell. Value  TempCell = Trim (TempCell)  cell. Value = TempCell Next cell  End Sub
The code above will loop through each cell in a selected range and apply the VBA Trim function to the value inside the cell. Similar to the power query Trim transformation, it will only remove the spaces at the start and end of any text.

Like the find and replace method, we will need to add two spaces as the Value To Find and a single space as the Replace With value. We can then press the OK button to add this transformation. We need to repeat this step until all the extra spaces have been removed from our data. To get the cleaned data back into Excel, we need to close and load the data. We can go to the Home tab in the power query editor ➜ press Close & Load ➜ choose Close & Load To ➜ choose a Table and select the location to load the table. Removing Extra Spaces Between Words With VBA
VBA also has a trim function built in. Sub TrimSpaces ()  Dim rng As Range Dim cell As Range Dim TempCell As String  Set rng = Selection  For Each cell In rng  TempCell = cell. Value  TempCell = Trim (TempCell)  cell. Value = TempCell Next cell  End Sub
The code above will loop through each cell in a selected range and apply the VBA Trim function to the value inside the cell. Similar to the power query Trim transformation, it will only remove the spaces at the start and end of any text.

How to remove extra spaces between words in cells in Excel? How to remove extra spaces between words in cells in Excel?
How to remove extra spaces between words in cells in Excel?
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Remove extra spaces between words with TRIM in Excel
Remove extra spaces between words with VBA
VBA: Remove extra spaces between words:
Remove extra spaces between words with Kutools for Excel
Relative articles:
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
 Using Efficient Tabs in Excel Like Chrome, Firefox and Safari! Save 50% of your time, and reduce thousands of mouse clicks for you every day! In Excel, you can remove extra spaces between words with TRIM. Please do as follows: Step 1. Type formula =TRIM (A1) in cell B1 which is adjacent to cell A1, see screenshot: Step 2. Press Enter key and select B1, then drag the fill handle over the range of cells that you want to apply this formula. And all extra spaces between characters have been removed from the range. See screenshot:

How to remove extra spaces between words in cells in Excel?

How to remove extra spaces between words in cells in Excel?
How to remove extra spaces between words in cells in Excel?
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Remove extra spaces between words with TRIM in Excel
Remove extra spaces between words with VBA
VBA: Remove extra spaces between words:
Remove extra spaces between words with Kutools for Excel
Relative articles:
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

Using Efficient Tabs in Excel Like Chrome, Firefox and Safari! Save 50% of your time, and reduce thousands of mouse clicks for you every day! In Excel, you can remove extra spaces between words with TRIM. Please do as follows: Step 1. Type formula =TRIM (A1) in cell B1 which is adjacent to cell A1, see screenshot: Step 2. Press Enter key and select B1, then drag the fill handle over the range of cells that you want to apply this formula. And all extra spaces between characters have been removed from the range. See screenshot:

Excel Text and String Functions: TRIM & CLEAN Excel Functions
Excel Functions
Excel Text and String Functions: TRIM & CLEAN
Excel Text and String Functions:
Removing spaces and nonprinting characters from text: Excel TRIM & CLEAN functions
Related Links:
TRIM Function (Worksheet)
Example:
=TRIM (" James Bond 007 ") [Formula]
CLEAN Function (Worksheet)
Example:
=CLEAN (A1) [Formula]
Use a combination of the TRIM, CLEAN and SUBSTITUTE functions
Example:
=TRIM (A1) [Formula]
=TRIM (SUBSTITUTE (A1, CHAR (160), CHAR (32))) [Formula]
Example:
=TRIM (SUBSTITUTE (A1,"/","")) [Formula]
Example:
=CLEAN (SUBSTITUTE (A1, CHAR (127), CHAR (7))) [Formula]
Example:
=CLEAN (SUBSTITUTE (A1,CHAR (128),CHAR (7))) [Formula]
Find ASCII value of Characters to be replaced
Find Visible Spaces:
Find Visible ASCII Characters:
=CODE (MID (A1,6,1)) [Formula]
Find Invisible spaces / characters:
Find All Spaces & Characters of ASCII value 127 and above, which cannot be removed by TRIM & CLEAN functions:
 3. Excel Text and String Functions: LEFT, RIGHT, MID, LEN, FIND, SEARCH, REPLACE, SUBSTITUTE. When you import data into an Excel worksheet, or download from internet, or copy from a website, or in case of multiple users working on the same worksheet, you might often find unnecessary spaces or irregular characters, at times invisible, which were not intended to be part of the actual data. To remove the extra / unwanted spaces and non-printable characters from the data, use the Excel TRIM & CLEAN functions. Leading and trailing blank characters will result in incorrect sorting & filtering of your data; extra spaces and characters will prevent correct working of your formulas (say, when you do a vlookup), cause formatting & calculation errors, and generally impede in manipulating text/data besides appearing visibly incorrect. TRIM Function (Worksheet)
Use the excel TRIM function to remove all spaces from text leaving only single spaces between words. Trim deletes all leading & trailing spaces in a text string, and multiple spaces within words are reduced to a single space. Note that Trim removes the space character with ANSI code 32, but does not remove the non-breaking space character in the Unicode character set with decimal value 160 which is used extensively in web pages (with html entity &nbsp).

3. Excel Text and String Functions: LEFT, RIGHT, MID, LEN, FIND, SEARCH, REPLACE, SUBSTITUTE. When you import data into an Excel worksheet, or download from internet, or copy from a website, or in case of multiple users working on the same worksheet, you might often find unnecessary spaces or irregular characters, at times invisible, which were not intended to be part of the actual data. To remove the extra / unwanted spaces and non-printable characters from the data, use the Excel TRIM & CLEAN functions. Leading and trailing blank characters will result in incorrect sorting & filtering of your data; extra spaces and characters will prevent correct working of your formulas (say, when you do a vlookup), cause formatting & calculation errors, and generally impede in manipulating text/data besides appearing visibly incorrect. TRIM Function (Worksheet)
Use the excel TRIM function to remove all spaces from text leaving only single spaces between words. Trim deletes all leading & trailing spaces in a text string, and multiple spaces within words are reduced to a single space. Note that Trim removes the space character with ANSI code 32, but does not remove the non-breaking space character in the Unicode character set with decimal value 160 which is used extensively in web pages (with html entity &nbsp).

Remove Extra Spaces from Excel Data | Pryor Learning Solutions Remove Extra Spaces from Excel Data
Remove Extra Spaces from Excel Data
Use the Trim Function
Use a Formula to Remove All Spaces
Bonus Hint!
Tepring Crocker
 Often, these issues are caused by extra spaces hiding before, after or between the text and numbers in your data. Especially when information has been copy/pasted into a spreadsheet, extra spaces can come along for the ride and lurk unnoticed until something goes wrong. Excel offers several ways to help you remove spaces and clean up your data, but you will want to choose the right technique for the type of data you are working with. The following tips will describe two methods using functions and formulas to remove unwanted spaces from your data. These steps will apply to Excel 2007-2013. Images were taken using Excel 2013 on the Windows 7 OS. Option 1
Use the Trim Function
The TRIM function removes all spaces from text except a single space between words. Use this function when you have text data that contains hidden spaces in the cell. In our example, you’ll see that there are multiple “Joe Smiths” in our data. At a glance, several of them even look the same.

Often, these issues are caused by extra spaces hiding before, after or between the text and numbers in your data. Especially when information has been copy/pasted into a spreadsheet, extra spaces can come along for the ride and lurk unnoticed until something goes wrong. Excel offers several ways to help you remove spaces and clean up your data, but you will want to choose the right technique for the type of data you are working with. The following tips will describe two methods using functions and formulas to remove unwanted spaces from your data. These steps will apply to Excel 2007-2013. Images were taken using Excel 2013 on the Windows 7 OS. Option 1
Use the Trim Function
The TRIM function removes all spaces from text except a single space between words. Use this function when you have text data that contains hidden spaces in the cell. In our example, you’ll see that there are multiple “Joe Smiths” in our data. At a glance, several of them even look the same.

How To Fix Excel TRIM Function Not Working Issue? How To Fix Excel TRIM Function Not Working Issue?
How To Fix Excel TRIM Function Not Working Issue?
How Trim Function Works In Excel?
How To Fix Excel TRIM Not Working Issue?
1# Remove Entire Spaces Including the Spaces Between Words
Here check out how to use SUBSTITUTE formula.
2# Remove Non-breaking Spaces
Follow the below-given instruction:
Removing non-breaking spaces
=TRIM (SUBSTITUTE (C1,CHAR (160),CHAR (32)))
How The Formula Works:
3# Considerations
4# Remove Space When Excel Says There Are No Spaces (but you see them!)
Follow the steps to remove spaces from Excel cell.
FAQ:
Conclusion:
Margret
 See the cell A2 in the screenshot,
Locate entire ” ” (in the inverted commas detect the gap by clicking space key on the keyboard)
And replace them with “” (detect no gap, you need to replace it with nothing)
The instance number will left blank as we need everything to be replaced
So this is trick that you can use to remove spaces when the TRIM function is not working. 2# Remove Non-breaking Spaces
You can remove the non-breaking space from the line of text by making use of TRIM, SUBSTITUTE, and CHAR functions. As inside the TRIM function, the SUBSTITUTE and CHAR functions are nested. And you can type the formula into the worksheet by using the functions dialog boxes for entering the arguments. Follow the below-given instruction: First, copy line of the below text that contains many non-breaking spaces between the words non-breaking and spaces, into the cell ( for example C1)
Removing non-breaking spaces
Then click cell C3 (this is the cell where the formula for removing the spaces will be placed)
And type the below-given formula in the cell C3 and hit Enter key
=TRIM (SUBSTITUTE (C1,CHAR (160),CHAR (32)))
The text line removing non-breaking spaces in Excel appear in cell C3 without any spaces between words
And click cell C3 for showing the complete formula> appears in the formula bar above the worksheet. In this way, you can remove space between the words when the Excel TRIM function won’t works. How The Formula Works: Each and every function performs its particular task: The CHAR function is used for entering ASCII codes for two different spaces into the formula – 160 & 32
The SUBSTITUTE function replaces entire non-breaking spaces between the words with regular spaces.

How To Fix Excel TRIM Function Not Working Issue?

How To Fix Excel TRIM Function Not Working Issue?
How To Fix Excel TRIM Function Not Working Issue?
How Trim Function Works In Excel?
How To Fix Excel TRIM Not Working Issue?
1# Remove Entire Spaces Including the Spaces Between Words
Here check out how to use SUBSTITUTE formula.
2# Remove Non-breaking Spaces
Follow the below-given instruction:
Removing non-breaking spaces
=TRIM (SUBSTITUTE (C1,CHAR (160),CHAR (32)))
How The Formula Works:
3# Considerations
4# Remove Space When Excel Says There Are No Spaces (but you see them!)
Follow the steps to remove spaces from Excel cell.
FAQ:
Conclusion:
Margret

Remove Spaces in Excel (Examples) | How To Remove Spaces? Excel Remove Spaces
Excel Remove Spaces
Excel Remove Spaces (Table of Contents)
Introduction to Remove Spaces in Excel
Different Types Of Spaces
TRIM Function
How to Remove Extra Spaces in Excel?
Example #1 – Remove Excel Spaces with the help of Find and Replace
Example #2 – Remove Excel Spaces with the help of TRIM Function
Example #3 – Remove Excel Spaces with the help of SUBSTITUTE Function
Things to Remember about Excel Remove Spaces
Recommended Articles
 Remove Spaces in Excel (Examples) | How To Remove Spaces? Excel Remove Spaces
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 with the help of the FIND and REPLACE option (Ctrl + H). There we need to put a space and replace that with Blank (Nothing kept). This removes the spaces anywhere from the selected cells. In another way, we can remove the spaces by using a TRIM function. This removes the spaces which are there 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. Start Your Free Excel Course
Excel functions, formula, charts, formatting creating excel dashboard & others
Different Types Of Spaces
It may contain extra spaces before text strings in cells;

Remove Spaces in Excel (Examples) | How To Remove Spaces?

Excel Remove Spaces
Excel Remove Spaces
Excel Remove Spaces (Table of Contents)
Introduction to Remove Spaces in Excel
Different Types Of Spaces
TRIM Function
How to Remove Extra Spaces in Excel?
Example #1 – Remove Excel Spaces with the help of Find and Replace
Example #2 – Remove Excel Spaces with the help of TRIM Function
Example #3 – Remove Excel Spaces with the help of SUBSTITUTE Function
Things to Remember about Excel Remove Spaces
Recommended Articles

Remove Spaces in Excel (Examples) | How To Remove Spaces? Excel Remove Spaces
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 with the help of the FIND and REPLACE option (Ctrl + H). There we need to put a space and replace that with Blank (Nothing kept). This removes the spaces anywhere from the selected cells. In another way, we can remove the spaces by using a TRIM function. This removes the spaces which are there 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. Start Your Free Excel Course
Excel functions, formula, charts, formatting creating excel dashboard & others
Different Types Of Spaces
It may contain extra spaces before text strings in cells;

How To Fix Excel TRIM Function Not Working Issue? How To Fix Excel TRIM Function Not Working Issue?
How To Fix Excel TRIM Function Not Working Issue?
How Trim Function Works In Excel?
How To Fix Excel TRIM Not Working Issue?
1# Remove Entire Spaces Including the Spaces Between Words
Here check out how to use SUBSTITUTE formula.
2# Remove Non-breaking Spaces
Follow the below-given instruction:
Removing non-breaking spaces
=TRIM (SUBSTITUTE (C1,CHAR (160),CHAR (32)))
How The Formula Works:
3# Considerations
4# Remove Space When Excel Says There Are No Spaces (but you see them!)
Follow the steps to remove spaces from Excel cell.
FAQ:
Conclusion:
Margret
 Commonly the TRIM function on its own removes the unwanted spaces, between the words or at the beginning or end of the text string. Well in some situations it is found this fails to work. And in a computer, a space in two words is not categorized as a blank area but as a character. And there is more than one type of space character. In Web pages, one space character that the TRIM function won’t remove is non-breaking space. So if from the Web pages you have imported or copied data than in this case you might not be able to remove extra spaced with TRIM function if they are created by non-breaking spaces. So here know what you need to do if the Excel trim not working, but before moving further check out recognize the differences between non-breaking and regular spaces. [cta- excel -repair-lite labl=”recover lost Excel data”]
How To Fix Excel TRIM Not Working Issue? 1# Remove Entire Spaces Including the Spaces Between Words
If you don’t want any spaces between the words and in a formula you were using TRIM then use SUBSTITUTE. Here check out how to use SUBSTITUTE formula.

Commonly the TRIM function on its own removes the unwanted spaces, between the words or at the beginning or end of the text string. Well in some situations it is found this fails to work. And in a computer, a space in two words is not categorized as a blank area but as a character. And there is more than one type of space character. In Web pages, one space character that the TRIM function won’t remove is non-breaking space. So if from the Web pages you have imported or copied data than in this case you might not be able to remove extra spaced with TRIM function if they are created by non-breaking spaces. So here know what you need to do if the Excel trim not working, but before moving further check out recognize the differences between non-breaking and regular spaces. [cta- excel -repair-lite labl=”recover lost Excel data”]
How To Fix Excel TRIM Not Working Issue? 1# Remove Entire Spaces Including the Spaces Between Words
If you don’t want any spaces between the words and in a formula you were using TRIM then use SUBSTITUTE. Here check out how to use SUBSTITUTE formula.

Remove Spaces in Excel - Leading, Trailing and Double Remove Extra Spaces in Excel (Leading, Trailing, Double Spaces)
Remove Extra Spaces in Excel (Leading, Trailing, Double Spaces)
FREE EXCEL TIPS EBOOK - Click here to get your copy
Watch Video – Remove Spaces in Excel
This Tutorial Covers:
How to Remove Spaces in Excel
Using the TRIM Function
Remove Extra Spaces in Excel using FIND and REPLACE
Removing Double Spaces
Removing Single Spaces
Remove Line Breaks
You may also like the following Excel tutorials:
FREE EXCEL BOOK
Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster
 How to Remove Spaces in Excel
Using the TRIM Function
Remove Extra Spaces in Excel using FIND and REPLACE
Removing Double Spaces
Removing Single Spaces
Remove Line Breaks
How to Remove Spaces in Excel
In this tutorial, I will show you two ways to remove spaces in Excel. Using TRIM function. Using Find and Replace. Using the TRIM Function
Excel TRIM function removes the leading and trailing spaces, and double spaces between text strings. For example, in the above example, to remove spaces from the entire list if first names (in A2: A7), use the following formula in cell C1 and drag it down for all the first names: =TRIM (A2)
Excel TRIM function would instantly remove all the leading and trailing spaces in the cell. Once you have the cleaned data, copy it paste it as values in place of the original data. This function is also helpful if you have more than one space character between words. It would remove the extra spaces such that the result always have one space character between words.

Remove Spaces in Excel - Leading, Trailing and Double

Remove Extra Spaces in Excel (Leading, Trailing, Double Spaces)
Remove Extra Spaces in Excel (Leading, Trailing, Double Spaces)
FREE EXCEL TIPS EBOOK - Click here to get your copy
Watch Video – Remove Spaces in Excel
This Tutorial Covers:
How to Remove Spaces in Excel
Using the TRIM Function
Remove Extra Spaces in Excel using FIND and REPLACE
Removing Double Spaces
Removing Single Spaces
Remove Line Breaks
You may also like the following Excel tutorials:
FREE EXCEL BOOK
Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

How to Remove Spaces in Excel
Using the TRIM Function
Remove Extra Spaces in Excel using FIND and REPLACE
Removing Double Spaces
Removing Single Spaces
Remove Line Breaks
How to Remove Spaces in Excel
In this tutorial, I will show you two ways to remove spaces in Excel. Using TRIM function. Using Find and Replace. Using the TRIM Function
Excel TRIM function removes the leading and trailing spaces, and double spaces between text strings. For example, in the above example, to remove spaces from the entire list if first names (in A2: A7), use the following formula in cell C1 and drag it down for all the first names: =TRIM (A2)
Excel TRIM function would instantly remove all the leading and trailing spaces in the cell. Once you have the cleaned data, copy it paste it as values in place of the original data. This function is also helpful if you have more than one space character between words. It would remove the extra spaces such that the result always have one space character between words.

Learn How to Remove Extra Spaces From Excel Using TRIM How to Remove Extra Spaces From Excel
How to Remove Extra Spaces From Excel
An easier way to clean up your Excel spreadsheet
How the TRIM Function Works
Using the TRIM Function
Removing Extra Spaces From an Entire Column
Using the Search and Replace Short Cut Key
Was this page helpful?
 Double-click the right mouse button to auto-fill the entire column
Now you'll have column A with the extra spaces, and column B with the same text cleaned up. Perform the same copy and paste (values only) procedure in the previous step, but copy and paste the entire columns rather than just individual cells. Finally, right click at the top of column B to highlight the entire column, and delete it, shifting all other cells on the spreadsheet to the left. Using the Search and Replace Short Cut Key
If the text in your column has extra spaces within the text, not right before or right after, you can quickly clean that text by using Excel's Search and Replace feature. Select the entire column you want to clean. Press the CTRL + H shortcut to open Excel's Search and Replace window. In the Find what field, type two spaces. In the Replace with field, type one space. Keep pressing the Replace All button until all extra spaces are gone. The benefit of using this approach is that you don't have to go through the entire copy-and-paste procedure that you need to with the TRIM function.

Learn How to Remove Extra Spaces From Excel Using TRIM

How to Remove Extra Spaces From Excel
How to Remove Extra Spaces From Excel
An easier way to clean up your Excel spreadsheet
How the TRIM Function Works
Using the TRIM Function
Removing Extra Spaces From an Entire Column
Using the Search and Replace Short Cut Key
Was this page helpful?

Double-click the right mouse button to auto-fill the entire column
Now you'll have column A with the extra spaces, and column B with the same text cleaned up. Perform the same copy and paste (values only) procedure in the previous step, but copy and paste the entire columns rather than just individual cells. Finally, right click at the top of column B to highlight the entire column, and delete it, shifting all other cells on the spreadsheet to the left. Using the Search and Replace Short Cut Key
If the text in your column has extra spaces within the text, not right before or right after, you can quickly clean that text by using Excel's Search and Replace feature. Select the entire column you want to clean. Press the CTRL + H shortcut to open Excel's Search and Replace window. In the Find what field, type two spaces. In the Replace with field, type one space. Keep pressing the Replace All button until all extra spaces are gone. The benefit of using this approach is that you don't have to go through the entire copy-and-paste procedure that you need to with the TRIM function.

4 Ways to Remove Unwanted Space Characters | How To Excel 4 Ways to Remove Unwanted Space Characters
4 Ways to Remove Unwanted Space Characters
Table of Contents
Our Example Data for the Post
Removing Extra Spaces with the TRIM Function
Removing Extra Spaces Between Words with Find and Replace
Removing Extra Spaces with Power Query
Removing Extra Spaces Between Words With VBA
Conclusions
Subscribe
Consulting
Excel Insights
Excel Functions eBook
Microsoft MVP
Categories
Advertisement
 Our data didn’t have any column headings, so we’ll leave the My table has headers box unchecked. Press the OK button to create the table and the power query editor will open up. Right click on the column heading ➜ choose Transform ➜ select Trim. Unfortunately, this doesn’t remove any extra spaces between the words and we need to implement a couple Replace Values transformation steps to accomplish this. Right click on the column and select Replace Values from the menu. Like the find and replace method, we will need to add two spaces as the Value To Find and a single space as the Replace With value. We can then press the OK button to add this transformation. We need to repeat this step until all the extra spaces have been removed from our data. To get the cleaned data back into Excel, we need to close and load the data. We can go to the Home tab in the power query editor ➜ press Close & Load ➜ choose Close & Load To ➜ choose a Table and select the location to load the table.

Our data didn’t have any column headings, so we’ll leave the My table has headers box unchecked. Press the OK button to create the table and the power query editor will open up. Right click on the column heading ➜ choose Transform ➜ select Trim. Unfortunately, this doesn’t remove any extra spaces between the words and we need to implement a couple Replace Values transformation steps to accomplish this. Right click on the column and select Replace Values from the menu. Like the find and replace method, we will need to add two spaces as the Value To Find and a single space as the Replace With value. We can then press the OK button to add this transformation. We need to repeat this step until all the extra spaces have been removed from our data. To get the cleaned data back into Excel, we need to close and load the data. We can go to the Home tab in the power query editor ➜ press Close & Load ➜ choose Close & Load To ➜ choose a Table and select the location to load the table.

Remove Trailing Spaces from Cells in Excel - Free Excel Tutorial Remove Trailing Spaces from Cells in Excel
Remove Trailing Spaces from Cells in Excel
Remove Trailing Spaces from Cells with Formula
Remove Trailing Spaces from Cells with VBA Macro
Related Functions
 B4 contain text string values, and you want to strip all leading and trailing spaces in the given range of cells, how to achieve it. You can use the following formula. = TRIM (B1)
Type this formula into a blank cell and then press Enter key, and drag the AutoFill Handle over other cells to apply this formula. This formula will remove both leading and trailing spaces from text string in cells. Remove Trailing Spaces from Cells with VBA Macro
You can also use an Excel VBA Macro to remote all trailing spaces from a given range of cells. Just do the following steps: #1 select one range of cells that you want to remove trailing spaces
#2 open your excel workbook and then click on “ Visual Basic ” command under DEVELOPER Tab, or just press “ ALT+F11 ” shortcut. #3 then the “ Visual Basic Editor ” window will appear. #4 click “ Insert ” ->” Module ” to create a new module. #5 paste the below VBA code into the code window.

Remove Trailing Spaces from Cells in Excel - Free Excel Tutorial

Remove Trailing Spaces from Cells in Excel
Remove Trailing Spaces from Cells in Excel
Remove Trailing Spaces from Cells with Formula
Remove Trailing Spaces from Cells with VBA Macro
Related Functions

B4 contain text string values, and you want to strip all leading and trailing spaces in the given range of cells, how to achieve it. You can use the following formula. = TRIM (B1)
Type this formula into a blank cell and then press Enter key, and drag the AutoFill Handle over other cells to apply this formula. This formula will remove both leading and trailing spaces from text string in cells. Remove Trailing Spaces from Cells with VBA Macro
You can also use an Excel VBA Macro to remote all trailing spaces from a given range of cells. Just do the following steps: #1 select one range of cells that you want to remove trailing spaces
#2 open your excel workbook and then click on “ Visual Basic ” command under DEVELOPER Tab, or just press “ ALT+F11 ” shortcut. #3 then the “ Visual Basic Editor ” window will appear. #4 click “ Insert ” ->” Module ” to create a new module. #5 paste the below VBA code into the code window.

Remove Spaces in Excel (Examples) | How To Remove Spaces? Excel Remove Spaces
Excel Remove Spaces
Excel Remove Spaces (Table of Contents)
Introduction to Remove Spaces in Excel
Different Types Of Spaces
TRIM Function
How to Remove Extra Spaces in Excel?
Example #1 – Remove Excel Spaces with the help of Find and Replace
Example #2 – Remove Excel Spaces with the help of TRIM Function
Example #3 – Remove Excel Spaces with the help of SUBSTITUTE Function
Things to Remember about Excel Remove Spaces
Recommended Articles
 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 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 only removes the ASCII space character (32) from the text. Popular Course in this category
Excel Training (18 Courses, 9+ Projects) 18 Online Courses | 9 Hands-on Projects | 95+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.9 (7,474 ratings)
Course Price
$29 $299
View Course
Related Courses
Excel Data Analysis Training (12 Courses, 8+ Projects) Excel for Finance Training (15 Courses, 7+ Projects)
How to Remove Extra Spaces in Excel? Remove extra spaces in Excel is very simple and easy.

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 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 only removes the ASCII space character (32) from the text. Popular Course in this category
Excel Training (18 Courses, 9+ Projects) 18 Online Courses | 9 Hands-on Projects | 95+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.9 (7,474 ratings)
Course Price
$29 $299
View Course
Related Courses
Excel Data Analysis Training (12 Courses, 8+ Projects) Excel for Finance Training (15 Courses, 7+ Projects)
How to Remove Extra Spaces in Excel? Remove extra spaces in Excel is very simple and easy.

Space Character: Remove Last Letter in Excel If It Is Blank Space Character: Remove Last Letter in Excel If It Is Blank
Space Character: Remove Last Letter in Excel If It Is Blank
Method 1: Remove the last letter if it is blank manually
Method 2: Remove the last letter of a cell if it is a space with formulas
So if you want to use the formula, the just copy it from above and replace “B5” with you cell reference.
Method 3: Remove the last space character of a cell faster and easier
This function is included in our Excel Add-In 'Professor Excel Tools'
Method 4: Remove all the spaces – except those between words
By Henrik Schiffner
 Download and try it for free: No sign-up, no installation (just activation within Excel) and a lot of other useful functions. This function is included in our Excel Add-In 'Professor Excel Tools'
Learn more Download Free Trial
(No sign-up, download starts directly)
More than 35,000 users can't be wrong. Method 4: Remove all the spaces – except those between words
There is another option, which is not as exact, but in most cases still possible: Use the TRIM formula. TRIM removes all the spaces except single spaces between words. It’s very easy to use: =TRIM (A1) removes all the spaces of cell A1 (as said, single space characters between words stay). Please note:

Space Character: Remove Last Letter in Excel If It Is Blank

Space Character: Remove Last Letter in Excel If It Is Blank
Space Character: Remove Last Letter in Excel If It Is Blank
Method 1: Remove the last letter if it is blank manually
Method 2: Remove the last letter of a cell if it is a space with formulas
So if you want to use the formula, the just copy it from above and replace “B5” with you cell reference.
Method 3: Remove the last space character of a cell faster and easier
This function is included in our Excel Add-In 'Professor Excel Tools'
Method 4: Remove all the spaces – except those between words
By Henrik Schiffner

Download and try it for free: No sign-up, no installation (just activation within Excel) and a lot of other useful functions. This function is included in our Excel Add-In 'Professor Excel Tools'
Learn more Download Free Trial
(No sign-up, download starts directly)
More than 35,000 users can't be wrong. Method 4: Remove all the spaces – except those between words
There is another option, which is not as exact, but in most cases still possible: Use the TRIM formula. TRIM removes all the spaces except single spaces between words. It’s very easy to use: =TRIM (A1) removes all the spaces of cell A1 (as said, single space characters between words stay). Please note:

How to remove extra spaces between words in cells in Excel? How to remove extra spaces between words in cells in Excel?
How to remove extra spaces between words in cells in Excel?
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Remove extra spaces between words with TRIM in Excel
Remove extra spaces between words with VBA
VBA: Remove extra spaces between words:
Remove extra spaces between words with Kutools for Excel
Relative articles:
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
 1
2
3
4
5
6
7
8
9
10
11
12
Sub TrimExcessSpaces ()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application. Selection
Set WorkRng = Application. InputBox ("Range", xTitleId, WorkRng. Address, Type:=8)
For Each Rng In WorkRng
Rng. Value = Application. WorksheetFunction. Trim (Rng. Value)
Next
End Sub
3. Click Run button or press F5 key to run the VBA. And a prompt box will pop out to remind you select the range that you want to remove the excess spaces, see screenshot:

1
2
3
4
5
6
7
8
9
10
11
12
Sub TrimExcessSpaces ()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application. Selection
Set WorkRng = Application. InputBox ("Range", xTitleId, WorkRng. Address, Type:=8)
For Each Rng In WorkRng
Rng. Value = Application. WorksheetFunction. Trim (Rng. Value)
Next
End Sub
3. Click Run button or press F5 key to run the VBA. And a prompt box will pop out to remind you select the range that you want to remove the excess spaces, see screenshot:

HOW to remove Extra space in the end of the word in Excel Sheet? | Yahoo Answers HOW to remove Extra space in the end of the word in Excel Sheet?
HOW to remove Extra space in the end of the word in Excel Sheet?
8 Answers
 You may, however, carry out the following steps to achieve the same: 1 - Go to Tools -> Macro -> Macros. Specify any name for the macro (let's say "NoSpaces") and click "Create"
2 - Copy-paste the following code in the editor: Sub NoSpaces ()
Dim c As Range
For Each c In Selection. Cells
c = trim (c)
Next
End Sub
3 - Close the editor and come back to your excel workbook
4 - Select the cell-range and go to Tools -> Macro -> Macros. Select "NoSpaces" and then click "Run". This will help you get rid of all the unwanted trailing spaces. ...Show more
Anonymous
1 decade ago
There is no single command in Excel to do this, but you can insert a temporary column to hold a formula to do this for you. Lets say you have the word "Arsene " in cell A3. Then in B3 you type =trim (A3) and copy down as required.

HOW to remove Extra space in the end of the word in Excel Sheet? | Yahoo Answers

HOW to remove Extra space in the end of the word in Excel Sheet?
HOW to remove Extra space in the end of the word in Excel Sheet?
8 Answers

You may, however, carry out the following steps to achieve the same: 1 - Go to Tools -> Macro -> Macros. Specify any name for the macro (let's say "NoSpaces") and click "Create"
2 - Copy-paste the following code in the editor: Sub NoSpaces ()
Dim c As Range
For Each c In Selection. Cells
c = trim (c)
Next
End Sub
3 - Close the editor and come back to your excel workbook
4 - Select the cell-range and go to Tools -> Macro -> Macros. Select "NoSpaces" and then click "Run". This will help you get rid of all the unwanted trailing spaces. ...Show more
Anonymous
1 decade ago
There is no single command in Excel to do this, but you can insert a temporary column to hold a formula to do this for you. Lets say you have the word "Arsene " in cell A3. Then in B3 you type =trim (A3) and copy down as required.

Remove Space in Excel | Top 5 Methods to Filter Data with Spaces Remove Space in Excel
Remove Space in Excel
Top 5 Methods to Filter Data with Spaces in Excel
#1 – How to Remove Space from the text in Excel Using Trim Function?
#2 – How to Remove Space Using Delimited in Text To Columns?
#3 – How to Remove Space in Excel Using Fixed Width in Text to Columns Option?
#4 – How to Remove Space Using Find & Replace Option?
#5 – How to Remove Space in Excel Using Substitute Function?
Explanation of Removing Spaces in Excel
Things to Remember
Recommended Articles
 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 in excel 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.

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 in excel 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.

18 ready-to-use VBA Codes that will save your day
18 ready-to-use VBA Codes that will save your day
November 21, 2017
Table of Contents
How to install a macro
1. Copy data from one file to another.
2. Show hidden rows
3. Delete empty rows and columns
4. Find a blank cell
5. Replace empty cells with a value.
6. Sort numbers
7. Remove empty spaces
8. Highlight dublicated values
9. Highlight top ten values
10. Highlight greater than values
11. Highlight cells with comments
12. Highlight Cells with Misspelled words
13. Create a pivot table
14. Attach active workbook in an Email
15. Send all Excel charts to a PowerPoint presentation
16. Send Excel table in MS Word
17. Extract a specific word from a cell
18. Protect your Workbook
 = xlAscending End Sub
7. Remove empty spaces
Occasionally, data in the workbook contains additional spaces (spaces) that can interfere with data analysis and to corrupt of formulas. Here’s a macro that will remove all the spaces from a preselected range of cells: Sub TrimTheSpaces () 'Declare your variables Dim MyRange As Range Dim MyCell As Range 'Save the Workbook before changing cells Select Case MsgBox ( "Can't Undo this action. " & _ " Save Workbook First?", vbYesNoCancel) Case Is = vbYes  ThisWorkbook. Save Case Is = vbCancel Exit Sub End Select 'Define the target Range. Set MyRange = Selection 'Start looping through the range. For Each MyCell In MyRange 'Trim the Spaces. If Not IsEmpty (MyCell) Then MyCell = Trim (MyCell) End If 'Get the next cell in the range Next MyCell End Sub
8.

18 ready-to-use VBA Codes that will save your day

18 ready-to-use VBA Codes that will save your day
November 21, 2017
Table of Contents
How to install a macro
1. Copy data from one file to another.
2. Show hidden rows
3. Delete empty rows and columns
4. Find a blank cell
5. Replace empty cells with a value.
6. Sort numbers
7. Remove empty spaces
8. Highlight dublicated values
9. Highlight top ten values
10. Highlight greater than values
11. Highlight cells with comments
12. Highlight Cells with Misspelled words
13. Create a pivot table
14. Attach active workbook in an Email
15. Send all Excel charts to a PowerPoint presentation
16. Send Excel table in MS Word
17. Extract a specific word from a cell
18. Protect your Workbook

= xlAscending End Sub
7. Remove empty spaces
Occasionally, data in the workbook contains additional spaces (spaces) that can interfere with data analysis and to corrupt of formulas. Here’s a macro that will remove all the spaces from a preselected range of cells: Sub TrimTheSpaces () 'Declare your variables Dim MyRange As Range Dim MyCell As Range 'Save the Workbook before changing cells Select Case MsgBox ( "Can't Undo this action. " & _ " Save Workbook First?", vbYesNoCancel) Case Is = vbYes  ThisWorkbook. Save Case Is = vbCancel Exit Sub End Select 'Define the target Range. Set MyRange = Selection 'Start looping through the range. For Each MyCell In MyRange 'Trim the Spaces. If Not IsEmpty (MyCell) Then MyCell = Trim (MyCell) End If 'Get the next cell in the range Next MyCell End Sub
8.

Remove Leading and Trailing Spaces - Free Excel Tutorial Remove Leading and Trailing Spaces
Remove Leading and Trailing Spaces
Method 1: Remove Leading and Trailing spaces with Excel Formula
Method 2: Remove Leading and Trailing spaces with Excel VBA macro
Related Functions
 Remove Leading and Trailing Spaces - Free Excel Tutorial
Remove Leading and Trailing Spaces
scott @ March 12, 2018 Excel Basics, Excel Examples
In this tutorial you will learn that how to remove leading or trailing spaces from a text string in a cell in Excel. This post will guide you how to delete leading or trailing spaces of all cells in a column. If you remove leading spaces in cells one by one by manually, it will waste a lot of time. So this post will show you two methods to quickly remove leading and trailing spaces from text in one or more cells in your worksheet. Assuming that you need to remove all leading spaces and trailing spaces in the range of cells A1: A4, you can refer to the following two methods to achieve it. Method 1: Remove Leading and Trailing spaces with Excel Formula
To remove leading and trailing spaces from text string in Cells, you can use the TRIM function to remove extra spaces. So you can type the following formula in Cell B1, then press Enter key. = TRIM (A1)
Then select Cell B1 and drag the AutoFill Handle down to other cells that you want to remove the leading or trailing spaces.

Remove Leading and Trailing Spaces - Free Excel Tutorial
Remove Leading and Trailing Spaces
scott @ March 12, 2018 Excel Basics, Excel Examples
In this tutorial you will learn that how to remove leading or trailing spaces from a text string in a cell in Excel. This post will guide you how to delete leading or trailing spaces of all cells in a column. If you remove leading spaces in cells one by one by manually, it will waste a lot of time. So this post will show you two methods to quickly remove leading and trailing spaces from text in one or more cells in your worksheet. Assuming that you need to remove all leading spaces and trailing spaces in the range of cells A1: A4, you can refer to the following two methods to achieve it. Method 1: Remove Leading and Trailing spaces with Excel Formula
To remove leading and trailing spaces from text string in Cells, you can use the TRIM function to remove extra spaces. So you can type the following formula in Cell B1, then press Enter key. = TRIM (A1)
Then select Cell B1 and drag the AutoFill Handle down to other cells that you want to remove the leading or trailing spaces.

Remove Spaces in Excel (Examples) | How To Remove Spaces? Excel Remove Spaces
Excel Remove Spaces
Excel Remove Spaces (Table of Contents)
Introduction to Remove Spaces in Excel
Different Types Of Spaces
TRIM Function
How to Remove Extra Spaces in Excel?
Example #1 – Remove Excel Spaces with the help of Find and Replace
Example #2 – Remove Excel Spaces with the help of TRIM Function
Example #3 – Remove Excel Spaces with the help of SUBSTITUTE Function
Things to Remember about Excel Remove Spaces
Recommended Articles
 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. For reference, I have done a number of character count 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 H) to apply the Find and Replace task. Now, I have to select the cell range where the Find and Replace parameter needs to be applied to remove extra spaces in excel. Now, to activate the find and replace option, press the shortcut key Ctrl + H, find and replace window appears. 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. It replaces all the blank spaces in the cell.

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. For reference, I have done a number of character count 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 H) to apply the Find and Replace task. Now, I have to select the cell range where the Find and Replace parameter needs to be applied to remove extra spaces in excel. Now, to activate the find and replace option, press the shortcut key Ctrl + H, find and replace window appears. 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. It replaces all the blank spaces in the cell.

Easily remove leading, trailing, extra or all spaces in cells Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Several Clicks To Remove Unneeded Spaces From Cells
Remove only leading spaces from cells
Use MID function to remove leading spaces only
=MID (B3,FIND (MID (TRIM (B3),1,1),B3),LEN (B3))
Use VBA code to remove leading spaces only
Remove only trailing spaces from cells
Remove all spaces from cells
Use SUBSTITUTE function to remove all spaces from cells
=SUBSTITUTE (B3," ","")
Use Find & Replace function to remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with the Kutools
Other practical cases related to Excel spaces
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier
 After removing all extra spaces, you need to replace the original data with the trimmed data by pressing the Ctrl + C, select the original data range and right click to select Values under the Paste Options section. Several Clicks To Remove Unneeded Spaces From Cells
With the Remove Spaces utility, only several clicks can help you removing not only leading spaces, trailing spaces, excess spaces but also all spaces from a range, multiple ranges or even the whole worksheet, which will save a lot of your working time. Kutools for Excel - Gathers more than 300 powerful advanced features, designed for 1500+ work scenarios, solve 80% Excel problems. Download and try the full feature free trial 30-day
Remove only leading spaces from cells
In some cases, you may need to remove the leading spaces only and keep all in-between spaces in cells as the below screenshot shown. This section introduce another formula and VBA code to solve this problem. Use MID function to remove leading spaces only
Select a blank cell (here I select cell D3), copy the below formula into it and press the Enter key. And then drag the Fill Handle down to apply the formula to other cells. =MID (B3,FIND (MID (TRIM (B3),1,1),B3),LEN (B3))
In this formula, B3 is the cell containing the text from which you want leading spaces to be removed. Note: This operation needs to be done in a new column.

After removing all extra spaces, you need to replace the original data with the trimmed data by pressing the Ctrl + C, select the original data range and right click to select Values under the Paste Options section. Several Clicks To Remove Unneeded Spaces From Cells
With the Remove Spaces utility, only several clicks can help you removing not only leading spaces, trailing spaces, excess spaces but also all spaces from a range, multiple ranges or even the whole worksheet, which will save a lot of your working time. Kutools for Excel - Gathers more than 300 powerful advanced features, designed for 1500+ work scenarios, solve 80% Excel problems. Download and try the full feature free trial 30-day
Remove only leading spaces from cells
In some cases, you may need to remove the leading spaces only and keep all in-between spaces in cells as the below screenshot shown. This section introduce another formula and VBA code to solve this problem. Use MID function to remove leading spaces only
Select a blank cell (here I select cell D3), copy the below formula into it and press the Enter key. And then drag the Fill Handle down to apply the formula to other cells. =MID (B3,FIND (MID (TRIM (B3),1,1),B3),LEN (B3))
In this formula, B3 is the cell containing the text from which you want leading spaces to be removed. Note: This operation needs to be done in a new column.

Remove Spaces in Excel (Examples) | How To Remove Spaces? Excel Remove Spaces
Excel Remove Spaces
Excel Remove Spaces (Table of Contents)
Introduction to Remove Spaces in Excel
Different Types Of Spaces
TRIM Function
How to Remove Extra Spaces in Excel?
Example #1 – Remove Excel Spaces with the help of Find and Replace
Example #2 – Remove Excel Spaces with the help of TRIM Function
Example #3 – Remove Excel Spaces with the help of SUBSTITUTE Function
Things to Remember about Excel Remove Spaces
Recommended Articles
 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 TRIM function). Note: This method is only used when you want to remove a leading & trailing type of extra spaces from selected cells or to remove all the spaces in the data range from excel completely. Example #2 – Remove Excel Spaces with the help of 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 a number of character count 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. Now, In cell H4, let’s apply a TRIM function.

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 TRIM function). Note: This method is only used when you want to remove a leading & trailing type of extra spaces from selected cells or to remove all the spaces in the data range from excel completely. Example #2 – Remove Excel Spaces with the help of 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 a number of character count 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. Now, In cell H4, let’s apply a TRIM function.

Remove Spaces in Excel (Examples) | How To Remove Spaces? Excel Remove Spaces
Excel Remove Spaces
Excel Remove Spaces (Table of Contents)
Introduction to Remove Spaces in Excel
Different Types Of Spaces
TRIM Function
How to Remove Extra Spaces in Excel?
Example #1 – Remove Excel Spaces with the help of Find and Replace
Example #2 – Remove Excel Spaces with the help of TRIM Function
Example #3 – Remove Excel Spaces with the help of SUBSTITUTE Function
Things to Remember about Excel Remove Spaces
Recommended Articles
 Now, to activate the find and replace option, press the shortcut key Ctrl + H, find and replace window appears. 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. It replaces all the blank spaces in the cell. 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 TRIM function). Note: This method is only used when you want to remove a leading & trailing type of extra spaces from selected cells or to remove all the spaces in the data range from excel completely.

Now, to activate the find and replace option, press the shortcut key Ctrl + H, find and replace window appears. 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. It replaces all the blank spaces in the cell. 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 TRIM function). Note: This method is only used when you want to remove a leading & trailing type of extra spaces from selected cells or to remove all the spaces in the data range from excel completely.

10 Super Neat Ways to Clean Data in Excel Spreadsheets 10 Super Neat Ways to Clean Data in Excel Spreadsheets
10 Super Neat Ways to Clean Data in Excel Spreadsheets
FREE EXCEL TIPS EBOOK - Click here to get your copy
Watch Video – 10 Ways to Clean Data in Excel
In this blog post, I will show you 10 simple ways to clean data in Excel.
This Tutorial Covers:
#1 Get Rid of Extra Spaces
Syntax: TRIM (text)
#2 Select and Treat All Blank Cells
#3 Convert Numbers Stored as Text into Numbers
#4 – Remove Duplicates
#5 Highlight Errors
Using Conditional Formatting
Using Go To Special
#6 Change Text to Lower/Upper/Proper Case
#7 Parse Data Using Text to Column
#8 Spell Check
#9 Delete all Formatting
#10 Use Find and Replace to Clean Data in Excel
You May Also Like the Following Excel Tutorials:
FREE EXCEL BOOK
Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster
 While you may somehow spot the extra spaces between words or numbers, trailing spaces are not even visible. Here is a neat way to get rid of these extra spaces – Use TRIM Function. Syntax: TRIM (text)
Excel TRIM function takes the cell reference (or text) as the input. It removes leading and trailing spaces as well as the additional spaces between words (except single spaces). #2 Select and Treat All Blank Cells
Blank cells can create havoc if not treated beforehand. I often face issues with blank cells in a data set that is used to create reports/dashboards. You may want to fill all blank cells with ‘0’ or ‘Not Available’, or may simply want to highlight it. If there is a huge data set, doing this manually could take hours. Thankfully, there is a way you can select all the blank cells at once.

10 Super Neat Ways to Clean Data in Excel Spreadsheets

10 Super Neat Ways to Clean Data in Excel Spreadsheets
10 Super Neat Ways to Clean Data in Excel Spreadsheets
FREE EXCEL TIPS EBOOK - Click here to get your copy
Watch Video – 10 Ways to Clean Data in Excel
In this blog post, I will show you 10 simple ways to clean data in Excel.
This Tutorial Covers:
#1 Get Rid of Extra Spaces
Syntax: TRIM (text)
#2 Select and Treat All Blank Cells
#3 Convert Numbers Stored as Text into Numbers
#4 – Remove Duplicates
#5 Highlight Errors
Using Conditional Formatting
Using Go To Special
#6 Change Text to Lower/Upper/Proper Case
#7 Parse Data Using Text to Column
#8 Spell Check
#9 Delete all Formatting
#10 Use Find and Replace to Clean Data in Excel
You May Also Like the Following Excel Tutorials:
FREE EXCEL BOOK
Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

While you may somehow spot the extra spaces between words or numbers, trailing spaces are not even visible. Here is a neat way to get rid of these extra spaces – Use TRIM Function. Syntax: TRIM (text)
Excel TRIM function takes the cell reference (or text) as the input. It removes leading and trailing spaces as well as the additional spaces between words (except single spaces). #2 Select and Treat All Blank Cells
Blank cells can create havoc if not treated beforehand. I often face issues with blank cells in a data set that is used to create reports/dashboards. You may want to fill all blank cells with ‘0’ or ‘Not Available’, or may simply want to highlight it. If there is a huge data set, doing this manually could take hours. Thankfully, there is a way you can select all the blank cells at once.

How to remove internal spaces in Excel string? How to remove internal spaces in Excel string?
How to remove internal spaces in Excel string?
Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier...
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Remove all spaces from string
Remove extra spaces from string
Remove spaces types as you need
Demo
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
 Select a cell where you will put the result, and type this formula =TRIM (A2), press Enter key, and then the drag the auto fill handle over the cells which need this formula. Remove spaces types as you need
But if you just only remove one type of spaces, for instance, you just want to remove the leading spaces, you can apply Kutools for Excel ’s Remove Spaces utility. Kutools for Excel, with more than 120 handy functions, makes your jobs easier. Go to Download
Free Trial 60 days
After installing Kutools for Excel, please do as below: （ Free Download Kutools for Excel Now!) 1. Select the stings you want to remove the spaces, and click Kutools > Text > Remove Spaces. See screenshot: 2. In the Remove Spaces dialog, check one option as you need, for instance, to remove leading spaces only, check Leading spaces option.

How to remove internal spaces in Excel string?

How to remove internal spaces in Excel string?
How to remove internal spaces in Excel string?
Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier...
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Remove all spaces from string
Remove extra spaces from string
Remove spaces types as you need
Demo
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

Select a cell where you will put the result, and type this formula =TRIM (A2), press Enter key, and then the drag the auto fill handle over the cells which need this formula. Remove spaces types as you need
But if you just only remove one type of spaces, for instance, you just want to remove the leading spaces, you can apply Kutools for Excel ’s Remove Spaces utility. Kutools for Excel, with more than 120 handy functions, makes your jobs easier. Go to Download
Free Trial 60 days
After installing Kutools for Excel, please do as below: （ Free Download Kutools for Excel Now!) 1. Select the stings you want to remove the spaces, and click Kutools > Text > Remove Spaces. See screenshot: 2. In the Remove Spaces dialog, check one option as you need, for instance, to remove leading spaces only, check Leading spaces option.

Failure to Look Up or Match Values in Excel Failure to Look Up Values in Excel
Failure to Look Up Values in Excel
#N/A - Lookup Failure Error
Step No. 1
Step No. 2
Possible Reason No. 1
Solution:
Possible Reason No. 2
Solution:
 In this case, the solution is to remove any additional characters from the cells. This can be done manually, but if you want to change several cells, it may be faster to use the Excel Trim function, as follows: Create a new column next to the one with the additional spaces in it. Use the Trim function in your new column, to get rid of extra spaces. (e.g. if the original data is in cell E2, the function =TRIM (E2) removes any leading or trailing spaces). Copy the Trim function down the entire column of values. Copy the contents of the new column and paste the values only into the original column, using paste->special->values. Delete the column containing the Trim function. Note that the Trim function removes trailing space characters from the start and end of a text string. However, if you have other unseen characters, you may need to carry out the above steps using the Excel Clean function instead of (or as well as) the Trim function.

Failure to Look Up or Match Values in Excel

Failure to Look Up Values in Excel
Failure to Look Up Values in Excel
#N/A - Lookup Failure Error
Step No. 1
Step No. 2
Possible Reason No. 1
Solution:
Possible Reason No. 2
Solution:

In this case, the solution is to remove any additional characters from the cells. This can be done manually, but if you want to change several cells, it may be faster to use the Excel Trim function, as follows: Create a new column next to the one with the additional spaces in it. Use the Trim function in your new column, to get rid of extra spaces. (e.g. if the original data is in cell E2, the function =TRIM (E2) removes any leading or trailing spaces). Copy the Trim function down the entire column of values. Copy the contents of the new column and paste the values only into the original column, using paste->special->values. Delete the column containing the Trim function. Note that the Trim function removes trailing space characters from the start and end of a text string. However, if you have other unseen characters, you may need to carry out the above steps using the Excel Clean function instead of (or as well as) the Trim function.

HOW to remove Extra space in the end of the word in Excel Sheet? | Yahoo Answers HOW to remove Extra space in the end of the word in Excel Sheet?
HOW to remove Extra space in the end of the word in Excel Sheet?
8 Answers
 Select "NoSpaces" and then click "Run". This will help you get rid of all the unwanted trailing spaces. ...Show more
Anonymous
1 decade ago
There is no single command in Excel to do this, but you can insert a temporary column to hold a formula to do this for you. Lets say you have the word "Arsene " in cell A3. Then in B3 you type =trim (A3) and copy down as required. This removes trailing spaces. With all these trim formulas highlighted, click COPY and then EDIT / PASTE SPECIAL and select Values and paste over the same cells just copied. This will remove the formulas and leaved the trimmed text. Copy again and paste over the original cells in column A. Remove the temporary column B if you used it. ...Show more
glendora
5 years ago
Edit>find>replace Find what: " " -

Select "NoSpaces" and then click "Run". This will help you get rid of all the unwanted trailing spaces. ...Show more
Anonymous
1 decade ago
There is no single command in Excel to do this, but you can insert a temporary column to hold a formula to do this for you. Lets say you have the word "Arsene " in cell A3. Then in B3 you type =trim (A3) and copy down as required. This removes trailing spaces. With all these trim formulas highlighted, click COPY and then EDIT / PASTE SPECIAL and select Values and paste over the same cells just copied. This will remove the formulas and leaved the trimmed text. Copy again and paste over the original cells in column A. Remove the temporary column B if you used it. ...Show more
glendora
5 years ago
Edit>find>replace Find what: " " -

Remove Trailing Spaces from Cells in Excel - Free Excel Tutorial Remove Trailing Spaces from Cells in Excel
Remove Trailing Spaces from Cells in Excel
Remove Trailing Spaces from Cells with Formula
Remove Trailing Spaces from Cells with VBA Macro
Related Functions
 Just do the following steps: #1 select one range of cells that you want to remove trailing spaces
#2 open your excel workbook and then click on “ Visual Basic ” command under DEVELOPER Tab, or just press “ ALT+F11 ” shortcut. #3 then the “ Visual Basic Editor ” window will appear. #4 click “ Insert ” ->” Module ” to create a new module. #5 paste the below VBA code into the code window. Then clicking “ Save ” button. Sub RemovTrailSpaces ()  Dim cel As Range  For Each cel In Selection. Cells  cel = Trim (cel)  Next End Sub
#6 back to the current worksheet, then run the above excel macro. Click Run button. #7 Let’s see the result.

Just do the following steps: #1 select one range of cells that you want to remove trailing spaces
#2 open your excel workbook and then click on “ Visual Basic ” command under DEVELOPER Tab, or just press “ ALT+F11 ” shortcut. #3 then the “ Visual Basic Editor ” window will appear. #4 click “ Insert ” ->” Module ” to create a new module. #5 paste the below VBA code into the code window. Then clicking “ Save ” button. Sub RemovTrailSpaces ()  Dim cel As Range  For Each cel In Selection. Cells  cel = Trim (cel)  Next End Sub
#6 back to the current worksheet, then run the above excel macro. Click Run button. #7 Let’s see the result.

Easily remove leading, trailing, extra or all spaces in cells Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Several Clicks To Remove Unneeded Spaces From Cells
Remove only leading spaces from cells
Use MID function to remove leading spaces only
=MID (B3,FIND (MID (TRIM (B3),1,1),B3),LEN (B3))
Use VBA code to remove leading spaces only
Remove only trailing spaces from cells
Remove all spaces from cells
Use SUBSTITUTE function to remove all spaces from cells
=SUBSTITUTE (B3," ","")
Use Find & Replace function to remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with the Kutools
Other practical cases related to Excel spaces
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier
 Open the worksheet contains the cells you will remove leading spaces from, and then press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window. 2. Click Insert > Module, then copy below VBA code into the Module window. 1
2
3
4
5
6
7
8
9
10
11
12
Sub RemoveTrailingSpaces ()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application. Selection
Set WorkRng = Application. InputBox ("Range", xTitleId, WorkRng. Address, Type:=8)
For Each Rng In WorkRng
Rng. Value = VBA.RTrim (Rng. Value)
Next
End Sub
3. Press the F5 key to run the code.

Easily remove leading, trailing, extra or all spaces in cells

Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Several Clicks To Remove Unneeded Spaces From Cells
Remove only leading spaces from cells
Use MID function to remove leading spaces only
=MID (B3,FIND (MID (TRIM (B3),1,1),B3),LEN (B3))
Use VBA code to remove leading spaces only
Remove only trailing spaces from cells
Remove all spaces from cells
Use SUBSTITUTE function to remove all spaces from cells
=SUBSTITUTE (B3," ","")
Use Find & Replace function to remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with the Kutools
Other practical cases related to Excel spaces
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier

Open the worksheet contains the cells you will remove leading spaces from, and then press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window. 2. Click Insert > Module, then copy below VBA code into the Module window. 1
2
3
4
5
6
7
8
9
10
11
12
Sub RemoveTrailingSpaces ()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application. Selection
Set WorkRng = Application. InputBox ("Range", xTitleId, WorkRng. Address, Type:=8)
For Each Rng In WorkRng
Rng. Value = VBA.RTrim (Rng. Value)
Next
End Sub
3. Press the F5 key to run the code.

Remove Spaces in Excel - Leading, Trailing and Double Remove Extra Spaces in Excel (Leading, Trailing, Double Spaces)
Remove Extra Spaces in Excel (Leading, Trailing, Double Spaces)
FREE EXCEL TIPS EBOOK - Click here to get your copy
Watch Video – Remove Spaces in Excel
This Tutorial Covers:
How to Remove Spaces in Excel
Using the TRIM Function
Remove Extra Spaces in Excel using FIND and REPLACE
Removing Double Spaces
Removing Single Spaces
Remove Line Breaks
You may also like the following Excel tutorials:
FREE EXCEL BOOK
Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster
 Now have a look at what happens when I use a VLOOKUP function to get the last name using the first name. You might not be able to spot the difference with the naked eye that there is an extra trailing space in the name that is causing this error. In this example, it was easy to spot the issue in such a small data set, but imagine having to check this for thousands of records. To be on the safe side, it is always a good idea to clean your data and remove spaces in Excel. This Tutorial Covers: How to Remove Spaces in Excel
Using the TRIM Function
Remove Extra Spaces in Excel using FIND and REPLACE
Removing Double Spaces
Removing Single Spaces
Remove Line Breaks
How to Remove Spaces in Excel
In this tutorial, I will show you two ways to remove spaces in Excel. Using TRIM function. Using Find and Replace. Using the TRIM Function
Excel TRIM function removes the leading and trailing spaces, and double spaces between text strings. For example, in the above example, to remove spaces from the entire list if first names (in A2:

Now have a look at what happens when I use a VLOOKUP function to get the last name using the first name. You might not be able to spot the difference with the naked eye that there is an extra trailing space in the name that is causing this error. In this example, it was easy to spot the issue in such a small data set, but imagine having to check this for thousands of records. To be on the safe side, it is always a good idea to clean your data and remove spaces in Excel. This Tutorial Covers: How to Remove Spaces in Excel
Using the TRIM Function
Remove Extra Spaces in Excel using FIND and REPLACE
Removing Double Spaces
Removing Single Spaces
Remove Line Breaks
How to Remove Spaces in Excel
In this tutorial, I will show you two ways to remove spaces in Excel. Using TRIM function. Using Find and Replace. Using the TRIM Function
Excel TRIM function removes the leading and trailing spaces, and double spaces between text strings. For example, in the above example, to remove spaces from the entire list if first names (in A2:

Data Cleanup Tips for Microsoft Excel - Office Articles Data Cleanup Tips for Microsoft Excel
Data Cleanup Tips for Microsoft Excel
Data Isn't Recognized Properly
Clean Up Extra Spaces or Characters Using Find and Replace
Use the TRIM Function to Remove Spaces
Use the CLEAN Function to Remove Non-Printing Characters
Vertical to Horizontal Addresses
Sorting as a Data Cleanup Tool
 Maybe there's 2 spaces between some of your words and you have multiple words in the cells. Find what: Type 2 spaces using the spacebar
Replace with: Type 1 space using the spacebar
Replace all
To cleanup phone lists when 8 people have submitted them all differently. Once you've deleted all the extra characters, and you have just 9 digits, you can then format the cells as a phone number, and it works just right. Find what: Type a left parenthesis (or a right parenthesis or a hyphen or a period)
Replace with: Leave this empty! Replace all
Use the TRIM Function to Remove Spaces
The TRIM function removes spaces to the left and right of your data, but not spaces between data within a single cell. Insert a blank column to the right of the column you want to trim.

Data Cleanup Tips for Microsoft Excel - Office Articles

Data Cleanup Tips for Microsoft Excel
Data Cleanup Tips for Microsoft Excel
Data Isn't Recognized Properly
Clean Up Extra Spaces or Characters Using Find and Replace
Use the TRIM Function to Remove Spaces
Use the CLEAN Function to Remove Non-Printing Characters
Vertical to Horizontal Addresses
Sorting as a Data Cleanup Tool

Maybe there's 2 spaces between some of your words and you have multiple words in the cells. Find what: Type 2 spaces using the spacebar
Replace with: Type 1 space using the spacebar
Replace all
To cleanup phone lists when 8 people have submitted them all differently. Once you've deleted all the extra characters, and you have just 9 digits, you can then format the cells as a phone number, and it works just right. Find what: Type a left parenthesis (or a right parenthesis or a hyphen or a period)
Replace with: Leave this empty! Replace all
Use the TRIM Function to Remove Spaces
The TRIM function removes spaces to the left and right of your data, but not spaces between data within a single cell. Insert a blank column to the right of the column you want to trim.

Remove spaces in Excel when trim doesn't work • AuditExcel.co.za Remove spaces in Excel when trim doesn’t work
Remove spaces in Excel when trim doesn’t work
Remove all the spaces including the spaces between words
What if Excel says there are no spaces (but you can see them!)
Subscribe to our YouTube Channel
Subscribe Now
Finding errors in your Excel spreadsheets with ExcelAnalyzer
Find inconsistent and overwritten formula in Excel. These are the easy spreadsheet errors to find.
 Remove spaces in Excel when trim doesn't work • AuditExcel.co.za

Home // Blog & Excel Tips // Remove spaces in Excel when trim doesn’t work
Remove spaces in Excel when trim doesn’t work
Adrian
Comments Closed
May 15, 2017
Oct 25, 2018
Uncategorised
An increasingly regular problem is to remove spaces in Excel when TRIM doesn’t work. TRIM is a great function for removing any extra spaces before and after a set of characters and limiting any spaces between words to a single space. But sometimes this still doesn’t work
Remove all the spaces including the spaces between words
If you don’t want to see even the single spaces you need to replace all the spaces with nothing. If you were using TRIM in a formula then the correct formula to rather use is SUBSTITUTE. So below in the SUBSTITUTE formula we tell it to
look at cell A2,
find all the ” ” (notice the gap between the inverted commas generated by clicking the space key on the keyboard)
replace them with “” (notice no gap- we are telling it to replace with nothing)
The instance number is left blank as we want everything to be replaced. What if Excel says there are no spaces (but you can see them!) If you do the above, or do a Find Replace, and Excel seems to ignore it and leave the spaces in, then it is likely that the ‘space’ you are looking at is not a space generated by your keyboard. There is an explanation for all of this but the quick fix is to copy the ‘space’ and paste that into your substitute function. So below we try the same thing and it doesn’t seem to make a difference. To remove these spaces from the Excel cell you would need to
highlight the gap in one of the cells
Copy the gap (easiest with CTRL + C)
Create the SUBSTITUTE formula but paste (CTRL + V) this item into the Old Text option (you won’t really see the difference but Excel sees the different type of space)
Now Excel will replace these so called spaces with nothing.

Remove spaces in Excel when trim doesn't work • AuditExcel.co.za

Remove spaces in Excel when trim doesn’t work
Remove spaces in Excel when trim doesn’t work
Remove all the spaces including the spaces between words
What if Excel says there are no spaces (but you can see them!)
Subscribe to our YouTube Channel
Subscribe Now
Finding errors in your Excel spreadsheets with ExcelAnalyzer
Find inconsistent and overwritten formula in Excel. These are the easy spreadsheet errors to find.

Remove extra spaces from the lookup value with TRIM in Excel Remove extra spaces from the lookup value with TRIM in Excel
Remove extra spaces from the lookup value with TRIM in Excel
Unbelievable! A tool changes the way on editing and browsing multiple Office documents.
Sample File
Other Operations (Articles) Related To VLOOKUP
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier
 Remove extra spaces from the lookup value with TRIM in Excel

Remove extra spaces from the lookup value with TRIM in Excel
Generally, you can use the VLOOKUP function to lookup a value and return the matched value. However, if there are some extra spaces, such as leading spaces or trailing spaces in cells, the formula will return an error value #N/A even if there is a value matched as below screenshot shown. Here this tutorial provides some tricks on solving this job. Unbelievable! A tool changes the way on editing and browsing multiple Office documents. Free Download Office Tab
Open files in multiple windows

Open files in one tabbed window with Office Tab

In this case, you can combine the VLOOKUP and TRIM functions to lookup value ignoring extra spaces. Select a blank cell that you will place the result, type this formula
=VLOOKUP ("HR",TRIM ($B$3:$C$6),2,0)
HR is the lookup value, you also can directly use the cell reference which contain the lookup value, such as =VLOOKUP (F2,TRIM ($B$3:$C$6),2,0)
B3: C6 is the table array you use, 2 is the column index you want to return. Press Shift + Ctrl + Ente r key to return the match value. Tip:

Remove extra spaces from the lookup value with TRIM in Excel

Remove extra spaces from the lookup value with TRIM in Excel
Remove extra spaces from the lookup value with TRIM in Excel
Unbelievable! A tool changes the way on editing and browsing multiple Office documents.
Sample File
Other Operations (Articles) Related To VLOOKUP
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier

Remove extra spaces from the lookup value with TRIM in Excel

Remove extra spaces from the lookup value with TRIM in Excel
Generally, you can use the VLOOKUP function to lookup a value and return the matched value. However, if there are some extra spaces, such as leading spaces or trailing spaces in cells, the formula will return an error value #N/A even if there is a value matched as below screenshot shown. Here this tutorial provides some tricks on solving this job. Unbelievable! A tool changes the way on editing and browsing multiple Office documents. Free Download Office Tab
Open files in multiple windows

Open files in one tabbed window with Office Tab

In this case, you can combine the VLOOKUP and TRIM functions to lookup value ignoring extra spaces. Select a blank cell that you will place the result, type this formula
=VLOOKUP ("HR",TRIM ($B$3:$C$6),2,0)
HR is the lookup value, you also can directly use the cell reference which contain the lookup value, such as =VLOOKUP (F2,TRIM ($B$3:$C$6),2,0)
B3: C6 is the table array you use, 2 is the column index you want to return. Press Shift + Ctrl + Ente r key to return the match value. Tip:

ASAP Utilities for Excel - Text » Delete leading, trailing and excessive spaces - ASAP Utilities, description of our Excel tools (English) ASAP Utilities, description of our Excel tools
ASAP Utilities, description of our Excel tools
Text » Delete leading, trailing and excessive spaces
Screenshots
Practical tricks on how this can help you
Starting this utility
 Quickly remove spaces from the beginning and end of your data
Tip: Get rid of unwanted spaces in your data
Starting this utility
In the Excel menu choose: ASAP Utilities » Text » Delete leading, trailing and excessive spaces
« Return to the list of “Text” tools . « Previous
Delete leading and trailing spaces
Next »
Clean data and formatting...
Download "The one essential add-in for all Excel users." Additional keywords for this tool: trim, Double space, extra spaces, remove excessive whitespace, unnecessary spaces, consecutive whitespace, reduce internal whitespace to single space, white space, removes extra white spaces between two words in a character string, =TRIM (), extraneous spaces, clean duff cells, fix empty cells that Excel does not recognize as empty, fix blank cells, blanks, remove unwanted space from cell

ASAP Utilities for Excel - Text » Delete leading, trailing and excessive spaces - ASAP Utilities, description of our Excel tools (English)

ASAP Utilities, description of our Excel tools
ASAP Utilities, description of our Excel tools
Text » Delete leading, trailing and excessive spaces
Screenshots
Practical tricks on how this can help you
Starting this utility

Quickly remove spaces from the beginning and end of your data
Tip: Get rid of unwanted spaces in your data
Starting this utility
In the Excel menu choose: ASAP Utilities » Text » Delete leading, trailing and excessive spaces
« Return to the list of “Text” tools . « Previous
Delete leading and trailing spaces
Next »
Clean data and formatting...
Download "The one essential add-in for all Excel users." Additional keywords for this tool: trim, Double space, extra spaces, remove excessive whitespace, unnecessary spaces, consecutive whitespace, reduce internal whitespace to single space, white space, removes extra white spaces between two words in a character string, =TRIM (), extraneous spaces, clean duff cells, fix empty cells that Excel does not recognize as empty, fix blank cells, blanks, remove unwanted space from cell

Add space between number and text in a cell in Excel Add space between number and text in a cell in Excel
Add space between number and text in a cell in Excel
Add space between number and text – the text always comes first
Generic formula
Arguments
How to use this formula?
=TRIM (REPLACE (B3,MIN (FIND ( {1,2,3,4,5,6,7,8,9,0},B3&"1234567890")),0," "))
How this formula works?
Add space between number and text – the number always comes first
Generic formula
Arguments
How to use this formula?
=TRIM (REPLACE (B3,MAX (IFERROR (FIND ( {0,1,2,3,4,5,6,7,8,9},B3,ROW (INDIRECT ("1:"&LEN (B3)))),0))+1,0," "))
Related functions
Related formulas
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
 2. Enter the below formula into it and then press the Ctrl + Shift + Enter keys simultaneously. =TRIM (REPLACE (B3,MAX (IFERROR (FIND ( {0,1,2,3,4,5,6,7,8,9},B3,ROW (INDIRECT ("1:"&LEN (B3)))),0))+1,0," "))
3. Select the result cell, and then drag it all the way down to apply the formula to other cells as the below screenshot shown. Notes: In the formula, B3 is the text string cell which you will add space between the text and number; This array formula can only add a space after the last number. For example, this formula will change 34C12GHH to 34C12 GHH. Related functions
Excel TRIM function
The Excel TRIM function removes all extra spaces from text string and only keeps single spaces between words. Excel REPLACE function
The Excel REPLACE function finds and replaces characters based on given location from text string with a new text.

Add space between number and text in a cell in Excel

Add space between number and text in a cell in Excel
Add space between number and text in a cell in Excel
Add space between number and text – the text always comes first
Generic formula
Arguments
How to use this formula?
=TRIM (REPLACE (B3,MIN (FIND ( {1,2,3,4,5,6,7,8,9,0},B3&"1234567890")),0," "))
How this formula works?
Add space between number and text – the number always comes first
Generic formula
Arguments
How to use this formula?
=TRIM (REPLACE (B3,MAX (IFERROR (FIND ( {0,1,2,3,4,5,6,7,8,9},B3,ROW (INDIRECT ("1:"&LEN (B3)))),0))+1,0," "))
Related functions
Related formulas
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

2. Enter the below formula into it and then press the Ctrl + Shift + Enter keys simultaneously. =TRIM (REPLACE (B3,MAX (IFERROR (FIND ( {0,1,2,3,4,5,6,7,8,9},B3,ROW (INDIRECT ("1:"&LEN (B3)))),0))+1,0," "))
3. Select the result cell, and then drag it all the way down to apply the formula to other cells as the below screenshot shown. Notes: In the formula, B3 is the text string cell which you will add space between the text and number; This array formula can only add a space after the last number. For example, this formula will change 34C12GHH to 34C12 GHH. Related functions
Excel TRIM function
The Excel TRIM function removes all extra spaces from text string and only keeps single spaces between words. Excel REPLACE function
The Excel REPLACE function finds and replaces characters based on given location from text string with a new text.

How to Remove Cell Indentation in Excel 2013 - Solve Your Tech How to Remove Cell Indentation in Excel 2013
How to Remove Cell Indentation in Excel 2013
Remove the Indentation Space Before Data in Excel 2013
Matthew Burleigh
 If you follow the steps below and the indentation is not removed, then you may have blank spaces preceding your data, as opposed to indentation formatting. If that is the case, then you will have more luck with the Excel TRIM function. For example, if you have data in the A1 cell that contains blank spaces that you wish to remove, then entering the formula =TRIM (A1) into a blank cell will remove spaces from the data. You can learn more about the TRIM function here. Open your Excel worksheet containing the indentation that you want to remove. Select the cells containing the indentation that you want to remove. If you wish to remove all indentation from your worksheet, then you can press Ctrl + A on your keyboard, or click the gray button above the row 1 heading, and to the left of the column A heading. Both of those options will select the entire sheet. Click the Home tab at the top of the window. Click the Decrease Indent button in the Alignment section of the ribbon until the indentation is remove.

How to Remove Cell Indentation in Excel 2013 - Solve Your Tech

How to Remove Cell Indentation in Excel 2013
How to Remove Cell Indentation in Excel 2013
Remove the Indentation Space Before Data in Excel 2013
Matthew Burleigh

If you follow the steps below and the indentation is not removed, then you may have blank spaces preceding your data, as opposed to indentation formatting. If that is the case, then you will have more luck with the Excel TRIM function. For example, if you have data in the A1 cell that contains blank spaces that you wish to remove, then entering the formula =TRIM (A1) into a blank cell will remove spaces from the data. You can learn more about the TRIM function here. Open your Excel worksheet containing the indentation that you want to remove. Select the cells containing the indentation that you want to remove. If you wish to remove all indentation from your worksheet, then you can press Ctrl + A on your keyboard, or click the gray button above the row 1 heading, and to the left of the column A heading. Both of those options will select the entire sheet. Click the Home tab at the top of the window. Click the Decrease Indent button in the Alignment section of the ribbon until the indentation is remove.

Easily remove leading, trailing, extra or all spaces in cells Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove spaces in Excel cells – leading spaces, trailing spaces, extra spaces or all spaces
Remove extra spaces including leading, trailing and excess in-between spaces from cells
Several Clicks To Remove Unneeded Spaces From Cells
Remove only leading spaces from cells
Use MID function to remove leading spaces only
=MID (B3,FIND (MID (TRIM (B3),1,1),B3),LEN (B3))
Use VBA code to remove leading spaces only
Remove only trailing spaces from cells
Remove all spaces from cells
Use SUBSTITUTE function to remove all spaces from cells
=SUBSTITUTE (B3," ","")
Use Find & Replace function to remove all spaces from cells
Easily remove leading, trailing, extra and all spaces from cells with the Kutools
Other practical cases related to Excel spaces
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab - brings tabbed interface to Office, and make your work much easier
 After removing all leading spaces, you need to replace the original data with the trimmed data without formulas. Use VBA code to remove leading spaces only
1. Open the worksheet contains the cells you will remove leading spaces from, and then press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window. 2. Click Insert > Module, then copy below VBA code into the Module window. 1
2
3
4
5
6
7
8
9
10
11
12
Sub RemoveLeadingSpaces ()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application. Selection
Set WorkRng = Application. InputBox ("Range", xTitleId, WorkRng. Address, Type:=8)
For Each Rng In WorkRng
Rng. Value = VBA.LTrim (Rng.

After removing all leading spaces, you need to replace the original data with the trimmed data without formulas. Use VBA code to remove leading spaces only
1. Open the worksheet contains the cells you will remove leading spaces from, and then press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window. 2. Click Insert > Module, then copy below VBA code into the Module window. 1
2
3
4
5
6
7
8
9
10
11
12
Sub RemoveLeadingSpaces ()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application. Selection
Set WorkRng = Application. InputBox ("Range", xTitleId, WorkRng. Address, Type:=8)
For Each Rng In WorkRng
Rng. Value = VBA.LTrim (Rng.

10 Super Neat Ways to Clean Data in Excel Spreadsheets 10 Super Neat Ways to Clean Data in Excel Spreadsheets
10 Super Neat Ways to Clean Data in Excel Spreadsheets
FREE EXCEL TIPS EBOOK - Click here to get your copy
Watch Video – 10 Ways to Clean Data in Excel
In this blog post, I will show you 10 simple ways to clean data in Excel.
This Tutorial Covers:
#1 Get Rid of Extra Spaces
Syntax: TRIM (text)
#2 Select and Treat All Blank Cells
#3 Convert Numbers Stored as Text into Numbers
#4 – Remove Duplicates
#5 Highlight Errors
Using Conditional Formatting
Using Go To Special
#6 Change Text to Lower/Upper/Proper Case
#7 Parse Data Using Text to Column
#8 Spell Check
#9 Delete all Formatting
#10 Use Find and Replace to Clean Data in Excel
You May Also Like the Following Excel Tutorials:
FREE EXCEL BOOK
Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster
 10 Super Neat Ways to Clean Data in Excel Spreadsheets
10 Super Neat Ways to Clean Data in Excel Spreadsheets
-- By Sumit Bansal
FREE EXCEL TIPS EBOOK - Click here to get your copy
Watch Video – 10 Ways to Clean Data in Excel
Data forms the backbone of any analysis that you do in Excel. And when it comes to data, there are tons of things that can go wrong – be it the structure, placement, formatting, extra spaces, and so on. In this blog post, I will show you 10 simple ways to clean data in Excel. This Tutorial Covers: #1 Get Rid of Extra Spaces
#2 Select and Treat All Blank Cells
#3 Convert Numbers Stored as Text into Numbers
#4 – Remove Duplicates
#5 Highlight Errors
#6 Change Text to Lower/Upper/Proper Case
#7 Parse Data Using Text to Column
#8 Spell Check
#9 Delete all Formatting
#10 Use Find and Replace to Clean Data in Excel
#1 Get Rid of Extra Spaces
Extra spaces are painfully difficult to spot. While you may somehow spot the extra spaces between words or numbers, trailing spaces are not even visible. Here is a neat way to get rid of these extra spaces – Use TRIM Function. Syntax: TRIM (text)
Excel TRIM function takes the cell reference (or text) as the input. It removes leading and trailing spaces as well as the additional spaces between words (except single spaces).

10 Super Neat Ways to Clean Data in Excel Spreadsheets
10 Super Neat Ways to Clean Data in Excel Spreadsheets
-- By Sumit Bansal
FREE EXCEL TIPS EBOOK - Click here to get your copy
Watch Video – 10 Ways to Clean Data in Excel
Data forms the backbone of any analysis that you do in Excel. And when it comes to data, there are tons of things that can go wrong – be it the structure, placement, formatting, extra spaces, and so on. In this blog post, I will show you 10 simple ways to clean data in Excel. This Tutorial Covers: #1 Get Rid of Extra Spaces
#2 Select and Treat All Blank Cells
#3 Convert Numbers Stored as Text into Numbers
#4 – Remove Duplicates
#5 Highlight Errors
#6 Change Text to Lower/Upper/Proper Case
#7 Parse Data Using Text to Column
#8 Spell Check
#9 Delete all Formatting
#10 Use Find and Replace to Clean Data in Excel
#1 Get Rid of Extra Spaces
Extra spaces are painfully difficult to spot. While you may somehow spot the extra spaces between words or numbers, trailing spaces are not even visible. Here is a neat way to get rid of these extra spaces – Use TRIM Function. Syntax: TRIM (text)
Excel TRIM function takes the cell reference (or text) as the input. It removes leading and trailing spaces as well as the additional spaces between words (except single spaces).

How to change the line spacing between two lines within one cell in Excel - Quora
How do I change the line spacing between two lines within one cell in Excel?
Sairam Subramaniam
Tom Welch
CA. Sagar Pokarna
Tatiana Ufimtceva
David Almada
Brad Yundt
Dan Wilson
Richard Harker
Stuart McCormack
KC Cromie
Maher Ali
 28.6K views
·
View upvotes
Stuart McCormack
, Still have my copy of Word Version 1
Answered 4 years ago · Author has 1.5K answers and 2.8M answer views
This is ugly, but it works. Leave a blank line (actually 2) via Alt+Enter. Set the font height of the blank line as necessary. Going to be a beach to maintain. 16.7K views
·
View upvotes
KC Cromie
, worked at Joseph-Beth Booksellers
Answered March 11, 2021 · Author has 61 answers and 149.3K answer views
Changing your font choice can help with this. I’ve found arial fonts - especially Arial Nova - are good for not leaving too much empty space between lines. 201 views
Maher Ali
, With 10 years experience
Answered 3 years ago · Author has 62 answers and 30K answer views
It is simple you can remove unwanted spaces by using excel formula, called TRIM. =trim (Refer the cell where is text) and then press enter. 6.2K views
There was an error loading more items.

How to change the line spacing between two lines within one cell in Excel - Quora

How do I change the line spacing between two lines within one cell in Excel?
Sairam Subramaniam
Tom Welch
CA. Sagar Pokarna
Tatiana Ufimtceva
David Almada
Brad Yundt
Dan Wilson
Richard Harker
Stuart McCormack
KC Cromie
Maher Ali

28.6K views
·
View upvotes
Stuart McCormack
, Still have my copy of Word Version 1
Answered 4 years ago · Author has 1.5K answers and 2.8M answer views
This is ugly, but it works. Leave a blank line (actually 2) via Alt+Enter. Set the font height of the blank line as necessary. Going to be a beach to maintain. 16.7K views
·
View upvotes
KC Cromie
, worked at Joseph-Beth Booksellers
Answered March 11, 2021 · Author has 61 answers and 149.3K answer views
Changing your font choice can help with this. I’ve found arial fonts - especially Arial Nova - are good for not leaving too much empty space between lines. 201 views
Maher Ali
, With 10 years experience
Answered 3 years ago · Author has 62 answers and 30K answer views
It is simple you can remove unwanted spaces by using excel formula, called TRIM. =trim (Refer the cell where is text) and then press enter. 6.2K views
There was an error loading more items.

How to count the number of characters excluding spaces in Excel cell? How to count the number of characters excluding spaces in Excel cell?
How to count the number of characters excluding spaces in Excel cell?
Count number of characters excluding spaces with formula
Remove all spaces of a cell then count the characters in a cell with Kutools for Excel
Count number of characters excluding spaces with formula
Remove all spaces of a cell then count the characters in a cell with Kutools for Excel
Relative Articles:
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
 See screenshot: 2. In the Remove Spaces dialog, check All spaces option, and you can preview the results form Preview pane. See screenshot: 3. Click Ok, and all the spaces are removed from each cell. Then select a blank cell, for instance, C1, and type =LEN (A1), and press Enter key, and drag autofill handle over the cells which need this formula. With Kutools for Excel ’s Remove Spaces, you can remove all leading spaces, trailing space, extract spaces, leading and trailing space from each cell as you need. Relative Articles: How to remove certain/specific character from cell in Excel?

How to count the number of characters excluding spaces in Excel cell?

How to count the number of characters excluding spaces in Excel cell?
How to count the number of characters excluding spaces in Excel cell?
Count number of characters excluding spaces with formula
Remove all spaces of a cell then count the characters in a cell with Kutools for Excel
Count number of characters excluding spaces with formula
Remove all spaces of a cell then count the characters in a cell with Kutools for Excel
Relative Articles:
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

See screenshot: 2. In the Remove Spaces dialog, check All spaces option, and you can preview the results form Preview pane. See screenshot: 3. Click Ok, and all the spaces are removed from each cell. Then select a blank cell, for instance, C1, and type =LEN (A1), and press Enter key, and drag autofill handle over the cells which need this formula. With Kutools for Excel ’s Remove Spaces, you can remove all leading spaces, trailing space, extract spaces, leading and trailing space from each cell as you need. Relative Articles: How to remove certain/specific character from cell in Excel?

How to Remove Additional, Double or Extra Spaces in Google sheets How to Remove Additional, Double or Extra Spaces in Google sheets
How to Remove Additional, Double or Extra Spaces in Google sheets
Remove Additional, Double or Extra Spaces in Google Sheets
Using the TRIM function
Syntax:
Argument:
Using the Find and Replace Command
Trim Whitespace Using Menu Command in Sheets
 When you click the ‘Replace all’ button, it will find all the double spaces and replace it with single space. This’s not applicable to the double or additional spaces returned by formulas. That means extra spaces that appear as a result of any formula will not be replaced with this command. In that case, wrap that formula with the TRIM function. Trim Whitespace Using Menu Command in Sheets
This is a relatively new menu option in Sheets. In this first, select the range containing the whitespace (extra space) to be removed. Then go to the menu Data > Trim Whitespace. That’s all. But it won’t remove whitespaces returned by formulas. This way you can remove additional, double or extra spaces in Google Sheets.

How to Remove Additional, Double or Extra Spaces in Google sheets

How to Remove Additional, Double or Extra Spaces in Google sheets
How to Remove Additional, Double or Extra Spaces in Google sheets
Remove Additional, Double or Extra Spaces in Google Sheets
Using the TRIM function
Syntax:
Argument:
Using the Find and Replace Command
Trim Whitespace Using Menu Command in Sheets

When you click the ‘Replace all’ button, it will find all the double spaces and replace it with single space. This’s not applicable to the double or additional spaces returned by formulas. That means extra spaces that appear as a result of any formula will not be replaced with this command. In that case, wrap that formula with the TRIM function. Trim Whitespace Using Menu Command in Sheets
This is a relatively new menu option in Sheets. In this first, select the range containing the whitespace (extra space) to be removed. Then go to the menu Data > Trim Whitespace. That’s all. But it won’t remove whitespaces returned by formulas. This way you can remove additional, double or extra spaces in Google Sheets.

Vlookup #N/A Error Excel Vlookup Tutorial Part 5.1 - Vlookup #N/A Error
Excel Vlookup Tutorial Part 5.1 - Vlookup #N/A Error
Vlookup #N/A Error
Diagnosing the Problem
Step 1 - Check The Syntax of Your Formula
Step 2 - Check Data Types
=ISTEXT (B1)
Solution: Force the Data to Have the Same Type
Step 3 - Check For True Equality Between 'Matching' Values
Possible Reason No. 1 - Different Data Types
Possible Reason No. 2 - Unseen Characters
Solution - Remove Unseen Characters
 Create a new column next to the one with the additional spaces in it. Use the Trim function in your new column, to get rid of extra spaces. (e.g. if the original data is in cell E2, the function =TRIM (E2) removes any leading or trailing spaces). Copy the Trim function down the entire column of values. Copy the contents of the new column and paste the values only into the original column, using paste->special->values. Delete the column containing the Trim function. Note that the Trim function removes trailing spaces from the start and end of a text string. However, if you have other unseen characters, you may need to carry out the above steps using the Excel Clean function instead of (or as well as) the Trim function. Further Vlookup troubleshooting tips are provided, in the form of a handy Vlookup Quick Reference Card, on the Microsoft Office website. Go to the Excel Vlookup Tutorial Part 5.2 - Vlookup #REF!

Vlookup #N/A Error

Excel Vlookup Tutorial Part 5.1 - Vlookup #N/A Error
Excel Vlookup Tutorial Part 5.1 - Vlookup #N/A Error
Vlookup #N/A Error
Diagnosing the Problem
Step 1 - Check The Syntax of Your Formula
Step 2 - Check Data Types
=ISTEXT (B1)
Solution: Force the Data to Have the Same Type
Step 3 - Check For True Equality Between 'Matching' Values
Possible Reason No. 1 - Different Data Types
Possible Reason No. 2 - Unseen Characters
Solution - Remove Unseen Characters

Create a new column next to the one with the additional spaces in it. Use the Trim function in your new column, to get rid of extra spaces. (e.g. if the original data is in cell E2, the function =TRIM (E2) removes any leading or trailing spaces). Copy the Trim function down the entire column of values. Copy the contents of the new column and paste the values only into the original column, using paste->special->values. Delete the column containing the Trim function. Note that the Trim function removes trailing spaces from the start and end of a text string. However, if you have other unseen characters, you may need to carry out the above steps using the Excel Clean function instead of (or as well as) the Trim function. Further Vlookup troubleshooting tips are provided, in the form of a handy Vlookup Quick Reference Card, on the Microsoft Office website. Go to the Excel Vlookup Tutorial Part 5.2 - Vlookup #REF!

Vlookup #N/A Error Excel Vlookup Tutorial Part 5.1 - Vlookup #N/A Error
Excel Vlookup Tutorial Part 5.1 - Vlookup #N/A Error
Vlookup #N/A Error
Diagnosing the Problem
Step 1 - Check The Syntax of Your Formula
Step 2 - Check Data Types
=ISTEXT (B1)
Solution: Force the Data to Have the Same Type
Step 3 - Check For True Equality Between 'Matching' Values
Possible Reason No. 1 - Different Data Types
Possible Reason No. 2 - Unseen Characters
Solution - Remove Unseen Characters
 2 - Unseen Characters
You may have unseen characters, such as spaces, at the start or end of either the lookup_value, or in the cells of your table_array. These characters cause the lookup_value and the 'matching' value in the table_array to be slightly different. Solution - Remove Unseen Characters
Double click on each of the cells and check the contents to see if there are any unseen characters at the start or end of the cells. If so, you will need to remove any additional characters from the cells. This can be done manually, but if you want to change several cells, it may be faster to use the Excel Trim function, as follows: Create a new column next to the one with the additional spaces in it. Use the Trim function in your new column, to get rid of extra spaces. (e.g. if the original data is in cell E2, the function =TRIM (E2) removes any leading or trailing spaces). Copy the Trim function down the entire column of values. Copy the contents of the new column and paste the values only into the original column, using paste->special->values.

Vlookup #N/A Error

2 - Unseen Characters
You may have unseen characters, such as spaces, at the start or end of either the lookup_value, or in the cells of your table_array. These characters cause the lookup_value and the 'matching' value in the table_array to be slightly different. Solution - Remove Unseen Characters
Double click on each of the cells and check the contents to see if there are any unseen characters at the start or end of the cells. If so, you will need to remove any additional characters from the cells. This can be done manually, but if you want to change several cells, it may be faster to use the Excel Trim function, as follows: Create a new column next to the one with the additional spaces in it. Use the Trim function in your new column, to get rid of extra spaces. (e.g. if the original data is in cell E2, the function =TRIM (E2) removes any leading or trailing spaces). Copy the Trim function down the entire column of values. Copy the contents of the new column and paste the values only into the original column, using paste->special->values.

Reducing file size in Microsoft Excel Reducing file size in Microsoft Excel
Reducing file size in Microsoft Excel
To reduce the file size, follow below given steps:-
Previous
 Select the cell E1. Press the key Ctrl+Space on your keyboard. Press Ctrl+Shit+Right Arrow key. Columns will get selected till the last row. Press Ctrl+- on the keyboard to delete the blank columns. This way the data size will reduce from 228KB to 194KB in Microsoft Excel. Previous
Next

Reducing file size in Microsoft Excel

Reducing file size in Microsoft Excel
Reducing file size in Microsoft Excel
To reduce the file size, follow below given steps:-
Previous

Select the cell E1. Press the key Ctrl+Space on your keyboard. Press Ctrl+Shit+Right Arrow key. Columns will get selected till the last row. Press Ctrl+- on the keyboard to delete the blank columns. This way the data size will reduce from 228KB to 194KB in Microsoft Excel. Previous
Next

How to replace multiple spaces with single space from cells in Excel? How to replace multiple spaces with single space from cells in Excel?
How to replace multiple spaces with single space from cells in Excel?
Replace multiple spaces with single space by using formula
Replace multiple spaces with single space by using VBA code
VBA code: Replace multiple spaces with singe space
Replace multiple spaces with single space by using Kutools for Excel
Click to know more about this Remove Spaces feature.
Click to Download Kutools for Excel and free trial Now!
Demo: Replace multiple spaces with single space by using Kutools for Excel
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
 InputBox ("Range", xTitleId, Workx. Address, Type:=8)
For Each x In Workx
x = WorksheetFunction. Trim (x)
Next x
End Sub
3. Then press F5 key to run this code, and a prompt box will pop out to remind you selecting the data range that you want to remove the extra spaces, see screenshot: 4. And then click OK button, all excess spaces have been replaced with single space among the text. Replace multiple spaces with single space by using Kutools for Excel
If you have other types of spaces need to be removed, such as removing the leading spaces, trailing spaces, all spaces of the text, I will recommend a powerful tool -- Kutools for Excel, with its Remove Spaces utility, you can remove any spaces as you need, such as leading space, trailing spaces, all spaces...
Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. Go to Download
Free Trial 30 days Purchase
PayPal / MyCommerce
After installing Kutools for Excel, please do as follows: 1.

How to replace multiple spaces with single space from cells in Excel?

How to replace multiple spaces with single space from cells in Excel?
How to replace multiple spaces with single space from cells in Excel?
Replace multiple spaces with single space by using formula
Replace multiple spaces with single space by using VBA code
VBA code: Replace multiple spaces with singe space
Replace multiple spaces with single space by using Kutools for Excel
Click to know more about this Remove Spaces feature.
Click to Download Kutools for Excel and free trial Now!
Demo: Replace multiple spaces with single space by using Kutools for Excel
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

InputBox ("Range", xTitleId, Workx. Address, Type:=8)
For Each x In Workx
x = WorksheetFunction. Trim (x)
Next x
End Sub
3. Then press F5 key to run this code, and a prompt box will pop out to remind you selecting the data range that you want to remove the extra spaces, see screenshot: 4. And then click OK button, all excess spaces have been replaced with single space among the text. Replace multiple spaces with single space by using Kutools for Excel
If you have other types of spaces need to be removed, such as removing the leading spaces, trailing spaces, all spaces of the text, I will recommend a powerful tool -- Kutools for Excel, with its Remove Spaces utility, you can remove any spaces as you need, such as leading space, trailing spaces, all spaces...
Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. Go to Download
Free Trial 30 days Purchase
PayPal / MyCommerce
After installing Kutools for Excel, please do as follows: 1.

How to Remove Additional, Double or Extra Spaces in Google sheets How to Remove Additional, Double or Extra Spaces in Google sheets
How to Remove Additional, Double or Extra Spaces in Google sheets
Remove Additional, Double or Extra Spaces in Google Sheets
Using the TRIM function
Syntax:
Argument:
Using the Find and Replace Command
Trim Whitespace Using Menu Command in Sheets
 If any of the cells in the range B2: B4 is blank, the formula without TRIM in the corresponding row will leave extra space in the output. Test it yourself. Additional Reading: Combine Text and Date in Google Sheets. Using the Find and Replace Command
To remove extra spaces in Google Sheets that using the Find and Replace command, you should know the number of spaces to remove. Steps: Open the Sheet tab from which you want to remove the extra spaces from text strings. Use the keyboard shortcut Ctrl+H or go to Edit > Find and Replace. Follow the below settings/instructions.

If any of the cells in the range B2: B4 is blank, the formula without TRIM in the corresponding row will leave extra space in the output. Test it yourself. Additional Reading: Combine Text and Date in Google Sheets. Using the Find and Replace Command
To remove extra spaces in Google Sheets that using the Find and Replace command, you should know the number of spaces to remove. Steps: Open the Sheet tab from which you want to remove the extra spaces from text strings. Use the keyboard shortcut Ctrl+H or go to Edit > Find and Replace. Follow the below settings/instructions.

How to Remove Additional, Double or Extra Spaces in Google sheets How to Remove Additional, Double or Extra Spaces in Google sheets
How to Remove Additional, Double or Extra Spaces in Google sheets
Remove Additional, Double or Extra Spaces in Google Sheets
Using the TRIM function
Syntax:
Argument:
Using the Find and Replace Command
Trim Whitespace Using Menu Command in Sheets
 How to Remove Additional, Double or Extra Spaces in Google sheets
How to Remove Additional, Double or Extra Spaces in Google sheets
By
Prashanth
0
You can remove additional, double or extra spaces in Google Sheets with either using a function or menu commands. The function we can use to remove additional spaces in Google Sheets data is called TRIM. Function: Combination formulas can sometimes return extra spaces if any of the functions used in the combination returns a blank. In such cases, it’s a must to remove additional spaces from the formula outputs in Google Spreadsheets. The TRIM function can be used with other formulas to remove such extra spaces. Menu Command: Other than the formula-based approach, if your Sheets data contain extra spaces as part of a typo or the data imported from ecternal sources, then you can use the Find and Replace command (Ctrl+H) or the new Trim whitespace command in Sheets. Remove Additional, Double or Extra Spaces in Google Sheets
As already told there are different methods for removing extra spaces in Google Sheets. Let’s start with the TRIM function.

How to Remove Additional, Double or Extra Spaces in Google sheets
How to Remove Additional, Double or Extra Spaces in Google sheets
By
Prashanth
0
You can remove additional, double or extra spaces in Google Sheets with either using a function or menu commands. The function we can use to remove additional spaces in Google Sheets data is called TRIM. Function: Combination formulas can sometimes return extra spaces if any of the functions used in the combination returns a blank. In such cases, it’s a must to remove additional spaces from the formula outputs in Google Spreadsheets. The TRIM function can be used with other formulas to remove such extra spaces. Menu Command: Other than the formula-based approach, if your Sheets data contain extra spaces as part of a typo or the data imported from ecternal sources, then you can use the Find and Replace command (Ctrl+H) or the new Trim whitespace command in Sheets. Remove Additional, Double or Extra Spaces in Google Sheets
As already told there are different methods for removing extra spaces in Google Sheets. Let’s start with the TRIM function.

25 Excel shortcuts for faster, better spreadsheets - Blog 25 Excel shortcuts for faster, better spreadsheets
25 Excel shortcuts for faster, better spreadsheets
Master Excel
Why you should use Excel shortcuts
How to use Microsoft Excel more efficiently: 25 Excel shortcuts
1. Move up through a selection of cells
2. Jump to top or bottom of the spreadsheet
3. Fill in cells with data from cells above
4. Fill in cell with data from adjacent cell
5. Insert new sheets
6. Quickly format anything
7. Add multiple rows or columns
8. Choose how to paste information
9. One-click select all
10. Look up function arguments
11. Add a date or a timestamp anywhere
12. Access print preview dialog
13. Easily select an entire row or column
14. Create, edit, run and delete macros
15. Delete a row or a column
16. Increase or decrease font size
17. Add comments to any cell
18. Automatically add cells
19. Hide rows quickly
20. Switch between open workbooks
21. Search the spreadsheet or replace data
22. Insert a function
23. Remove spaces with TRIM
24. Copy formula down the entire column
25. Work with ranges
Final thoughts on Excel shortcuts
 All you have to do is press = button or Shift + F3. Doing so will bring up the Formula Builder dialog where you can look up a specific function and quickly add it to your sheet. 23. Remove spaces with TRIM
Extra spaces in your columns and rows can lead to a lot of trouble when you’re working with Excel. You could be trying to calculate the value of rows and cells and get only zeros as a result. Another issue with spaces is that you cannot effectively compare cell values. You can easi

25 Excel shortcuts for faster, better spreadsheets - Blog

25 Excel shortcuts for faster, better spreadsheets
25 Excel shortcuts for faster, better spreadsheets
Master Excel
Why you should use Excel shortcuts
How to use Microsoft Excel more efficiently: 25 Excel shortcuts
1. Move up through a selection of cells
2. Jump to top or bottom of the spreadsheet
3. Fill in cells with data from cells above
4. Fill in cell with data from adjacent cell
5. Insert new sheets
6. Quickly format anything
7. Add multiple rows or columns
8. Choose how to paste information
9. One-click select all
10. Look up function arguments
11. Add a date or a timestamp anywhere
12. Access print preview dialog
13. Easily select an entire row or column
14. Create, edit, run and delete macros
15. Delete a row or a column
16. Increase or decrease font size
17. Add comments to any cell
18. Automatically add cells
19. Hide rows quickly
20. Switch between open workbooks
21. Search the spreadsheet or replace data
22. Insert a function
23. Remove spaces with TRIM
24. Copy formula down the entire column
25. Work with ranges
Final thoughts on Excel shortcuts

All you have to do is press = button or Shift + F3. Doing so will bring up the Formula Builder dialog where you can look up a specific function and quickly add it to your sheet. 23. Remove spaces with TRIM
Extra spaces in your columns and rows can lead to a lot of trouble when you’re working with Excel. You could be trying to calculate the value of rows and cells and get only zeros as a result. Another issue with spaces is that you cannot effectively compare cell values. You can easi