Hyphenate two last-name columns
Turn Reed and Park into Reed-Park for letters and envelopes.
What you'll make

The formula

| Number | Part | What it does | Result so far |
|---|---|---|---|
| 1 | TRIM(A8)="" | Checks whether the first part is empty. | Not empty |
| 2 | TRIM(B8) | Shows the second part alone when the first is empty. | Not used for row 8 |
| 3 | TRIM(A8) | The first part, without stray spaces. | "Reed" |
| 4 | IF(TRIM(B8)…) | Adds a hyphen and the second part, if there is one. | "Reed-Park" |
| 5 | IF( … ) | Picks one part alone or both joined. | "Reed-Park" |
Read it left to right. The hyphen appears only when both parts are there.
=IF(TRIM(A8)="",TRIM(B8),TRIM(A8)&IF(TRIM(B8)="","","-"&TRIM(B8)))How to use it
Yellow bar at the top? Click Enable Editing.
- See it work. The Example tab shows 20 made-up names with the formula already in.
- Use your own names. On the Template tab, paste the first part of each last name into column A. Put the second part into column B. Leave one empty if a person has only one.
- Move them into your letter. Copy the results. Then use Paste Special and choose Values.
Before you send
Check that each person really uses both last names, in this order, before you send.
Route: Get names ready for the letter
Microsoft's help: IF function
OTHER ROUTES YOU MIGHT LIKE

Put a preferred name in the middle
Ava + Avie + Reed → Ava (Avie) Reed
Get the template →
Make a Dear Title Last Name greeting
Dr. + Reed → Dear Dr. Reed,
Get the template →
Combine a contact name and company
Ava Reed + Acme → Ava Reed — Acme
Get the template →
Fix "Dear ," when a first name is blank
(blank) → Dear colleague,
Take this route →