Flip surname-first fields at a separator
Turn de la Cruz|Mary Ann into Mary Ann de la Cruz, with the separator from column B.
Download Excel templateMicrosoft 365
What you'll make

The formula

| Number | Part | What it does | Result so far |
|---|---|---|---|
| 1 | TEXTAFTER(A8,B8) | Takes the given names after the separator. | "Mary Ann" |
| 2 | " " | Adds a space. | "Mary Ann " |
| 3 | TEXTBEFORE(A8,B8) | Adds the surname from before the separator. | "Mary Ann de la Cruz" |
| 4 | TRIM( … ) | Removes any extra spaces. | "Mary Ann de la Cruz" |
| 5 | IFERROR( … ) | With no separator, keeps the name as it is. | "Mary Ann de la Cruz" |
Read it left to right. A cell with no separator stays as it is.
=IFERROR(TRIM(TEXTAFTER(A8,B8)&" "&TEXTBEFORE(A8,B8)),TRIM(A8))How to use it
Yellow bar at the top? Click Enable Editing.
- See it work. The Example tab shows 20 made-up names with the formula already in.
- Use your own names. Paste surname-first names into column A of the Template tab and their separator into column B. Given names first fill in by themselves.
- Move them into your letter. Copy the results. Then use Paste Special and choose Values.
Before you send
Type the separator exactly as it is in the cell. Each name should have it only once.
Route: Get names ready for the letter
Microsoft's help: TEXTAFTER function
OTHER ROUTES YOU MIGHT LIKE

Flip Last, Given, Suffix names
Reed, Ava Marie, Jr. → Ava Marie Reed Jr.
Get the template →
Put a known surname first with a suffix
Ava Reed, Jr. + Reed → Reed, Ava, Jr.
Get the template →
Remove all credentials after a name
Ava Reed, CPA, MBA → Ava Reed
Get the template →
Fix "Dear ," when a first name is blank
(blank) → Dear colleague,
Take this route →