Combine a contact name and company

Turn Ava Reed and Acme into Ava Reed — Acme for labels and lists.

What you'll make

In Excel: Ava Reed + Acme becomes Ava Reed — Acme.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1TRIM(A8)=""Checks whether the contact name is empty.Not empty
2TRIM(B8)Shows the company alone when the name is empty.Not used for row 8
3TRIM(A8)The contact name, without stray spaces."Ava Reed"
4IF(TRIM(B8)…)Adds a long dash and the company, if there is one."Ava Reed — Acme"
5IF( … )Picks the name, the company, or both joined."Ava Reed — Acme"

Read it left to right. The dash appears only when both 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.

  1. See it work. The Example tab shows 20 made-up names with the formula already in.
  2. Use your own names. Paste contact names into column A and companies into column B of the Template tab. Leave one empty if you don't have it.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

This makes a label, not a full name. Check each person still works at that company.

Route: Get names ready for the letter

Microsoft's help: IF function