Fix spaces around commas in names

Turn Reed ,Ava into Reed, Ava so Last, First names look right.

What you'll make

In Excel: Reed ,Ava becomes Reed, Ava.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8The name with a badly spaced comma."Reed ,Ava"
2TRIM( … )Removes extra spaces, leaving single ones."Reed ,Ava"
3SUBSTITUTE( … " ," … )Removes the space before the comma."Reed,Ava"
4SUBSTITUTE( … "," … )Puts a space after each comma."Reed, Ava"
5TRIM( … )Shrinks any doubled spaces back to one."Reed, Ava"

Each bracket wraps the one above it, so Excel works from the inside out.

=TRIM(SUBSTITUTE(SUBSTITUTE(TRIM(A8)," ,",","),",",", "))

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up names with the formula already in.
  2. Use your own names. Paste Last, First names into the green column of the Template tab. Fixed names fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Extra or trailing commas stay, like Reed, Ava, so check rows with more than one comma.

Route: Get names ready for the letter

Microsoft's help: SUBSTITUTE function