Recover the firm from a mailstop field

Turn Acme Co. | MAILSTOP: 4B-210 into Acme Co.

What you'll make

In Excel: Acme Co. | MAILSTOP: 4B-210 becomes Acme Co.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1TEXTBEFORE(A8," | MAILSTOP: ")Keeps the text before | MAILSTOP: and its spaces."Acme Co."
2"Review mailstop separator"What the cell says without that separator.Not used for row 8
3IFERROR( … )Uses part 2 when part 1 finds no separator."Acme Co."

Only | MAILSTOP: in capitals, with its spaces, counts. The word Mailstop inside a firm name stays.

=IFERROR(TEXTBEFORE(A8," | MAILSTOP: "),"Review mailstop separator")

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up examples with the formula already in.
  2. Use your own firms. Paste each firm and mailstop field into the green column of the Template tab. The firms fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

This keeps only the firm. Keep your original column, since it still holds the mailstop.

Microsoft's help: TEXTBEFORE function