Collapse two copies of a known name

Turn Ava Reed Ava Reed into Ava Reed when you know the name.

What you'll make

In Excel: Ava Reed Ava Reed + expected Ava Reed becomes Ava Reed.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1TRIM(A8)=TRIM(B8)&" "&TRIM(B8)Checks whether the cell is the name typed twice.Match
2TRIM(B8)If it is, the expected name once."Ava Reed"
3TRIM(A8)Otherwise the cell, without stray spaces.Not used for row 8
4IF( … )Picks the right result for the row."Ava Reed"

Read it left to right. Capitals and extra spaces don't matter in part 1, so ava reed ava reed matches too.

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

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

Before you send

Only an exact double gets fixed. Ava Reed A. Reed stays as it is, so check those by hand.

Route: Get names ready for the letter

Microsoft's help: IF function