Share a surname when surnames match

Turn Ava Reed and Noah Reed into Ava & Noah Reed for one envelope.

What you'll make

In Excel: Ava Reed + Noah Reed becomes Ava & Noah Reed.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesFor row 8
1TRIM(B8)=TRIM(D8)Checks whether both last names are the same.Same
2TRIM(A8)&" & "…If they match, joins both first names and one last name."Ava & Noah Reed"
3TRIM(A8&" "&B8)…If not, joins both full names with &.Not used for row 8
4IF( … )Picks the right result for the row."Ava & Noah Reed"

Matching ignores capitals and extra spaces. A shared last name is spelled as in column B.

=IF(TRIM(B8)=TRIM(D8),TRIM(A8)&" & "&TRIM(C8)&" "&TRIM(B8),TRIM(A8&" "&B8)&" & "&TRIM(C8&" "&D8))

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 each person's first and last name into the green columns of the Template tab.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Last names must be spelled the same to be shared. Check each pair lives together.

Route: Get names ready for the letter

Microsoft's help: IF function