Add space after comma in string
This tutorial explains how to use a combination of the TRIM and the SUBSTITUTE function to add space after comma in a text string in Excel.
How to add space after comma in a string in Excel?
Supposing you have received a list containing names with no space after the comma as the below screenshot shown, you can apply the following formula to add space after the comma easily.
How to use this formula?
1. Select a blank cell to output the result. Here I select cell D3.
2. Enter the below formula into it and press the Enter key. And then drag its Fill Handle down to apply the formula to other cells.
Then you can see a space is added after each comma in specific cells as the above screenshot shown.
How this formula works?
- SUBSTITUTE(B3,",",", "): The SUBSTITUTE function replaces a comma "," with ", " (there is a space after the comma) in "Doe,Jane"., and returns the result as "Doe, Jane".
- TRIM("Doe, Jane"): The TRIM function removes all extract spaces from "Doe, Jane" and keeps only single space between words.