Reorder Last|First|Middle fields

Turn Reed|Ava|Marie into Ava Marie Reed, with the separator from column B.

What you'll make

In Excel: Reed|Ava|Marie + | becomes Ava Marie Reed.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1TEXTBEFORE(TEXTAFTER(A8,B8),B8)Takes the first name between the two separators."Ava"
2TEXTAFTER(A8,B8,-1)Adds a space and the middle name after the last separator."Ava Marie"
3TEXTBEFORE(A8,B8)Adds a space and the last name before the first separator."Ava Marie Reed"
4TRIM( … )Removes extra spaces, like when the middle is empty."Ava Marie Reed"
5IFERROR( … ,"Review format")Says Review format when a separator is missing."Ava Marie Reed"

Read it left to right. Each " " between parts adds a space.

=IFERROR(TRIM(TEXTBEFORE(TEXTAFTER(A8,B8),B8)&" "&TEXTAFTER(A8,B8,-1)&" "&TEXTBEFORE(A8,B8)),"Review format")

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|Middle names into column A of the Template tab and their separator into column B. Names fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Each name needs exactly three fields and two separators. Check any row that has more.

Route: Get names ready for the letter

Microsoft's help: TEXTAFTER function