How do I add commas between words in Excel with an example?

Adding commas between words in Excel can be done by using the CONCATENATE function. This function combines multiple strings or cells into one string, with a separator between each string. To add commas, simply insert a comma within the quotation marks in the formula, before or after the string or cell reference. For example, if you want to combine the words “apple”, “banana”, and “orange” into one cell with commas between them, the formula would be =CONCATENATE(“apple”, “,”,”banana”, “,” “orange”). This would result in the cell displaying “apple, banana, orange”.


You can use the following formula to add commas between words in Excel:

=SUBSTITUTE(TRIM(A2)," ",", ")

This particular formula adds commas between each word in cell A2.

The following example shows how to use this formula in practice.

Example: How to Add Commas Between Words in Excel

Suppose we have the following column in Excel that contains the names of basketball players on various teams:

Suppose we would like to add a comma in between the names in each row.

We can type the following formula into cell B2 to do so:

=SUBSTITUTE(TRIM(A2)," ",", ")

We can then click and drag this formula down to each remaining cell in column B:

Excel add comma between words

Column B now displays the names from each corresponding cell in column A with commas in between each name.

How This Formula Works

Recall the formula that we used to add commas in between the words in cell A2:

=SUBSTITUTE(TRIM(A2)," ",", ")

Here is how this formula works:

Then we use the SUBSTITUTE function to substitute a single comma and a space for each occurrence of a single space.

We then repeat this same process for each cell in column A.

The end result is that we’re able to add commas between each word for each cell in column A.

Additional Resources

The following tutorials explain how to perform other common operations in Excel:

x