LearnExcel.io
Menu

How to Remove Space from Excel

Written by ··Updated March 14, 2024
How to Remove Space from Excel

As an expert in Microsoft Excel, you may come across the need to remove unnecessary spaces from your spreadsheet. Removing spaces can help you clean up your data, make it easier to work with, and reduce the chance of errors. Whether it’s extra spaces before or after your data or between words, removing unwanted spaces can be done easily in Excel using various methods. In this post, we will guide you on how to remove space from Excel in a concise, quick, and direct manner.

Introduction

Excel is a powerful tool that allows you to organize, analyze and manipulate data. However, sometimes, you may encounter extra spaces in your data, which can make it harder to work with. In this post, we have put together some quick and easy ways to remove extraneous spaces from your Excel spreadsheet. Let’s dive in and explore!

Method 1: TRIM Function

The TRIM function is a built-in function in Excel that removes all extra spaces from text, except for single spaces between words. Here are the steps to use the TRIM function:

  1. Select the cell or column that contains the text you want to trim.
  2. Enter the following formula in an empty cell: =TRIM(cell), where “cell” is the cell address of the cell you want to remove spaces from. For example, if your data is in cell B2, you would use the formula =TRIM(B2).
  3. Press Enter to apply the formula.
  4. Copy the formula down the column using the fill handle.
  5. Finally, select the column that contains the trimmed data, and copy and paste it as values to remove the formula and keep the trimmed data.

Method 2: Find and Replace

You can also use the Find and Replace feature in Excel to remove extra spaces. Here’s how:

  1. Select the cell or column that contains the text you want to remove spaces from.
  2. Press CTRL + H to open the Find and Replace dialog box.
  3. In the “Find what” field, enter a double space (two consecutive spaces). Leave the “Replace with” field blank.
  4. Click on the “Replace All” button.
  5. Repeat steps 3-4, replacing double spaces with single spaces until Excel reports that no further replacements were made.

Method 3: Flash Fill

Flash Fill is a new feature introduced in Excel 2013 that allows you to extract, combine or format data by example. Here’s how to remove spaces using Flash Fill:

  1. Enter the first value in a new column or row that you want to format.
  2. Excel will recognize the pattern and display a preview of the formatted values.
  3. Press CTRL + E to fill the pattern to the bottom of the column or row.

Conclusion

There you have it – three quick and easy ways to remove spaces from your Excel spreadsheet. Whether you choose the TRIM function, Find and Replace, or Flash Fill, you can quickly clean your data and make it easier to work with. Give these methods a try and see how they work for you!

Bonus Tips

Here are a few bonus tips to help you work with spaces in Excel:

Use LEN Function to Count Spaces

You can use the LEN function to count the number of spaces in a cell. Here’s how:

  1. Select the cell you want to count the spaces in.
  2. Enter the following formula in an empty cell: =LEN(cell)-LEN(SUBSTITUTE(cell," ","")), where “cell” is the cell address of the cell you want to count the spaces in.
  3. Press Enter to apply the formula.

Use TRIM with CONCATENATE to Remove Spaces Between Words

If you have spaces between words that you want to remove, you can use the TRIM function with the CONCATENATE function. Here’s how:

  1. Select the cell or cells you want to remove spaces from.
  2. Enter the following formula in an empty cell: =TRIM(CONCATENATE(cell1,cell2,cell3,...)), where “cell1”, “cell2”, “cell3”, etc. are the cell addresses of the cells you want to remove spaces from.
  3. Press Enter to apply the formula.

Conclusion

By using these simple techniques in Excel, you can easily remove unnecessary spaces from your data and make it more manageable. Whether you choose the TRIM function, Find and Replace, Flash Fill, or the bonus tips we’ve provided, keep playing around with your data and find what works best for you and your needs. As always, practice makes perfect, so keep at it!

FAQs

Here are some frequently asked questions that you may have about removing spaces from Excel:

What is the TRIM Function?

The TRIM function is a built-in function in Excel that removes all extra spaces from text, except for single spaces between words. It is a quick and easy way to clean up your data and make it easier to work with.

How do I use the Find and Replace feature to remove extra spaces?

To remove extra spaces using Find and Replace, select the cell or column that contains the text you want to remove spaces from, press CTRL + H to open the Find and Replace dialog box, and in the “Find what” field, enter a double space (two consecutive spaces). Leave the “Replace with” field blank, click on the “Replace All” button, and repeat the process until Excel reports that no further replacements were made.

What is Flash Fill, and how do I use it to remove spaces?

Flash Fill is a new feature introduced in Excel 2013 that allows you to extract, combine or format data by example. To remove spaces using Flash Fill, enter the first value in a new column or row that you want to format, and Excel will recognize the pattern and display a preview of the formatted values. Press CTRL + E to fill the pattern to the bottom of the column or row.

How do I count the number of spaces in a cell?

You can use the LEN function to count the number of spaces in a cell. Select the cell you want to count the spaces in, enter the formula =LEN(cell)-LEN(SUBSTITUTE(cell,” “,””)), where “cell” is the cell address of the cell you want to count the spaces in, and press Enter to apply the formula.

What do I do if I have spaces between words that I want to remove?

If you have spaces between words that you want to remove, you can use the TRIM function with the CONCATENATE function. Select the cell or cells you want to remove spaces from, enter the formula =TRIM(CONCATENATE(cell1,cell2,cell3,…)), where “cell1”, “cell2”, “cell3”, etc. are the cell addresses of the cells you want to remove spaces from, and press Enter to apply the formula.

Related guides

How To

How to Space Down in Excel

Learn how to space down in Excel to easily organize and structure your data! This simple technique will save you time and boost your productivity.

May 20, 2023

Excel Add-ins

How to Remove Excel Add-ins

Learn how to remove Excel add-ins with our simple step-by-step guide. Keeping your Excel application up-to-date and organized has never been easier!

May 20, 2023

How To

How to Remove Apostrophe in Excel

Learn how to remove apostrophes in Excel with our step-by-step guide. Say goodbye to errors and hassles in your Excel sheets with this simple technique.

May 20, 2023

View all How To guides →