Avoid adding a first name twice

Join a first name and surname, without doubling a first name that's already there.

What you'll make

In Excel: Ava + Ava Reed becomes Ava Reed.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1LEFT(TRIM(B8),LEN(TRIM(A8))+1)The start of column B, as long as part 2."Ava "
2TRIM(A8)&" "The first name with a space after it."Ava "
3TRIM(B8)Column B alone, when it already has the first name."Ava Reed"
4TRIM(A8&" "&B8)Joins the first name and surname with one space.Not used for row 8
5IF( … )Skips adding the first name when parts 1 and 2 match."Ava Reed"

Read it left to right. Capitals don't matter when parts 1 and 2 are compared, so ava matches Ava.

=IF(LEFT(TRIM(B8),LEN(TRIM(A8))+1)=TRIM(A8)&" ",TRIM(B8),TRIM(A8&" "&B8))

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 first names into column A of the Template tab and surnames or full names 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

Column B should hold a surname or a full name. A nickname at the start, like Avie Reed, still gets the first name added.

Route: Get names ready for the letter

Microsoft's help: LEFT function