Intro
Learn how to replace with space in Excel using three easy methods. Discover how to substitute text, numbers, or formulas with a space using formulas, find and replace function, or VBA macros. Master Excel formatting and editing with these expert tips, and improve your data management and analysis skills.
Many Excel users have encountered the frustration of dealing with data that contains unnecessary characters, such as commas, semicolons, or other punctuation marks. These characters can make it difficult to work with the data, especially when trying to perform calculations or analyze the information. One common issue is the need to replace commas or other characters with spaces in Excel. In this article, we will explore three ways to replace characters with spaces in Excel, making it easier to work with your data.
Method 1: Using the SUBSTITUTE Function
One of the most straightforward ways to replace characters with spaces in Excel is by using the SUBSTITUTE function. This function replaces a specified character or text string with another character or text string. To use the SUBSTITUTE function, follow these steps:
- Select the cell where you want to display the modified text.
- Type
=SUBSTITUTE(
to start the function. - Select the cell that contains the original text.
- Enter the character you want to replace, enclosed in double quotes.
- Enter the character you want to replace it with, also enclosed in double quotes.
- Close the function with a parenthesis.
For example, if you want to replace commas with spaces in the text "Hello, World!", you would enter the following formula:
=SUBSTITUTE(A1, ",", " ")
This formula assumes that the original text is in cell A1.
Example Use Case:
Suppose you have a list of names in a column, and each name is separated by a comma. You want to replace the commas with spaces to make the names easier to read. You can use the SUBSTITUTE function to achieve this.
Original Text | Modified Text |
---|---|
John, Doe | John Doe |
Jane, Smith | Jane Smith |
Bob, Johnson | Bob Johnson |
Method 2: Using the FIND and REPLACE Functions
Another way to replace characters with spaces in Excel is by using the FIND and REPLACE functions. These functions work together to find and replace specific characters or text strings. To use the FIND and REPLACE functions, follow these steps:
- Select the cell where you want to display the modified text.
- Type
=REPLACE(
to start the function. - Select the cell that contains the original text.
- Enter the position of the character you want to replace, using the FIND function.
- Enter the number of characters you want to replace.
- Enter the character you want to replace it with.
- Close the function with a parenthesis.
For example, if you want to replace commas with spaces in the text "Hello, World!", you would enter the following formula:
=REPLACE(A1, FIND(",", A1), 1, " ")
This formula assumes that the original text is in cell A1.
Example Use Case:
Suppose you have a list of product codes in a column, and each code is separated by a semicolon. You want to replace the semicolons with spaces to make the codes easier to read. You can use the FIND and REPLACE functions to achieve this.
Original Text | Modified Text |
---|---|
ABC;123 | ABC 123 |
DEF;456 | DEF 456 |
GHI;789 | GHI 789 |
Method 3: Using Text to Columns
A third way to replace characters with spaces in Excel is by using the Text to Columns feature. This feature allows you to split text into separate columns based on a specified delimiter. To use Text to Columns, follow these steps:
- Select the cell that contains the original text.
- Go to the "Data" tab in the ribbon.
- Click on the "Text to Columns" button.
- Select the delimiter you want to use to split the text.
- Choose the destination for the split text.
- Click "Finish" to split the text.
For example, if you want to replace commas with spaces in the text "Hello, World!", you would follow these steps:
- Select the cell that contains the original text.
- Go to the "Data" tab in the ribbon.
- Click on the "Text to Columns" button.
- Select the comma as the delimiter.
- Choose a new column to display the split text.
- Click "Finish" to split the text.
Example Use Case:
Suppose you have a list of addresses in a column, and each address is separated by a comma. You want to replace the commas with spaces to make the addresses easier to read. You can use the Text to Columns feature to achieve this.
Original Text | Modified Text |
---|---|
123 Main St, Anytown, USA | 123 Main St Anytown USA |
456 Elm St, Othertown, USA | 456 Elm St Othertown USA |
789 Oak St, Thirdtown, USA | 789 Oak St Thirdtown USA |
Replace Characters with Spaces in Excel Gallery
We hope this article has helped you learn three ways to replace characters with spaces in Excel. Whether you're working with text data or numerical data, these techniques can help you manipulate your data to make it more readable and easier to work with. If you have any questions or need further assistance, please don't hesitate to ask.