Skip to main content

Excel Formula: Add comma between names

Author: Sun Last Modified: 2020-02-26

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

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...


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
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations