Skip to main content

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.

Generic formula

=TRIM(SUBSTITUTE(A1,",",", "))


A1: Represents the cell containing the text string you will add a space after the comma.

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.

=TRIM(SUBSTITUTE(B3,",",", "))

Then you can see a space is added after each comma in specific cells as the above screenshot shown.

How this formula works?

=TRIM(SUBSTITUTE(B3,",",", "))

  • 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.

Related functions

Excel TRIM function
The Excel TRIM function removes all extra spaces from text string and only keeps single spaces between words.

Excel SUBSTITUTE function
The Excel SUBSTITUTE function replaces text or characters within a text string with another text or characters.

Related formulas

Add comma after first word in a cell in Excel
To add a comma after the first word only in a cell, the formula in this tutorial can do you a favor.

Separate numbers from units of measurement
This article explains how to use formula to separate numbers from unites of measurement.

Split text and numbers in a cell in Excel
If you want to split text and numbers in a cell into different column cells with formulas, this formula tutorial will do you a favor.

Split Text String At Specific Character In A Cell In Excel
This tutorial explains how to split texts string at a specific character into separate column cells with formulas in Excel.

Add A Specific Character Before Each Word In A Cell
This tutorial provides a formula in detailed steps to help add a specific character before each word in a cell in Excel.

The Best Office Productivity Tools

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations