Make a greeting for two titled surnames

Turn Dr. Reed and Prof. Park into Dear Dr. Reed and Prof. Park, for one letter.

What you'll make

In Excel: Dr. + Reed + Prof. + Park becomes Dear Dr. Reed and Prof. Park,.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1TRIM(B8)=""Checks whether the first last name is empty.Not empty
2"Dear "Starts with Dear and a space."Dear "
3TRIM(A8&" "&B8)Adds the first title and last name."Dear Dr. Reed"
4IF(TRIM(D8)…)&","Adds and the second person, if any, then a comma." and Prof. Park,"
5IF( … )Shows nothing when the first last name is empty."Dear Dr. Reed and …"

Read it left to right. Part 4 also adds the comma at the end. A blank title leaves no extra space.

=IF(TRIM(B8)="","","Dear "&TRIM(A8&" "&B8)&IF(TRIM(D8)="",""," and "&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 titles and last names into the green columns of the Template tab. Leave the second pair empty for one person.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Titles are used exactly as typed, and none are guessed. Check each one is the title the person uses.

Route: Get names ready for the letter

Microsoft's help: IF function