Get middle names from a full name

Pull Marie out of Ava Marie Reed, so each name has its own column.

What you'll make

In Excel: Ava Marie Reed becomes Marie.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1TRIM(A8)The full name, without stray spaces."Ava Marie Reed"
2TEXTAFTER( … ," ")Drops the first word, the first name."Marie Reed"
3TEXTBEFORE( … ," ",-1)Drops the last word, the last name."Marie"
4TRIM( … )Removes any spaces left at the ends."Marie"
5IFERROR( … ,"")Shows nothing when there is no middle name."Marie"

Each bracket wraps the one above it, so Excel works from the inside out. The -1 means the last space.

=IFERROR(TRIM(TEXTBEFORE(TEXTAFTER(TRIM(A8)," ")," ",-1)),"")

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

Before you send

The first word counts as the first name and the last word as the last name. Mary Ann de la Cruz would give Ann de la, so check longer names by hand.

Route: Get names ready for the letter

Microsoft's help: TEXTBEFORE function