Note: The other languages of the website are Google-translated. Back to English

Excel Formula: Add comma between names

Supposing there is a list of customer names in a worksheet, you need to add comma between the first name and last name as below screenshot shown, how can you quickly solve it instead of manual typing commas? Here provides formulas for solving this job in Excel.
doc abbreviate words 1

Only add comma after first name

If you just want to add comma after first name, you can use a formula which combines FIND and REPLACE functions.
doc add comma between names 2

Generic formula:

REPLACE(txt,FIND(" ",txt),0,",")


Txt: the name you want to add comma.

How this formula work

Here is a full name in cell B3, now in cell C3, you can use below formula to add the comma after the first name.

=REPLACE(B3,FIND(" ",B3),0,",")

Press Enter key.
doc add comma between names 3


FINDfunctiin: the FIND function gets the location of a specific character in a text string. Here it is used to find the location of first space in the cell B3, it returns 5.

REPLACE function: the REPLACE function replaces the old text specified by a location in the given text string with a new one. But if the num_char argument in the REPLACE function is zero, it adds the new character. Now here it adds comma before the character in 5th position of the text in cell B3.

Add commas between names (first name, middle name and last name)

If you want to add commas between names as below screenshot shown, you can use the formula which combines SUBSTITUTE function and TRIM function.
doc add comma between names 4

Generic formula:

SUBSTITUTE(TRIM(txt)," ",", ")


Txt: the full name you used to add comma.

How this formula work

Example: to add commas between names in range B3:B8, please use below formula:

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

Press Enter key, then drag fill handle down to cell B8, now the commas have been added between names.
doc add comma between names 5


TRIM function: this function used to remove the extra spaces in the text string.

SUBSTITUTE function: this function replaces old text with a new one. Here it replaces all spaces with spaces plus commas.


If you do not need to remove extra space, just directly use the SUBSTITUTE function.

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

Sample File

doc sampleClick to download sample file

Relative Formulas

Relative Functions

The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 80% time for you.

  • Designed for 1500 work scenarios, helps you solve 80% Excel problems.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 30-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.
Ribbon of Excel (with Kutools for Excel installed)

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, Firefox, And New Internet Explorer.
Screen Shot of Excel (with Office Tab installed)
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations

Follow Us

Copyright © 2009 - | All rights reserved. Powered by ExtendOffice. | Sitemap
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.
Protected by Sectigo SSL