Add an extension to a phone number

Turn (201) 555-0123 and 0012 into (201) 555-0123 ext. 0012. A lone extension is flagged.

What you'll make

In Excel: (201) 555-0123 and 0012 becomes (201) 555-0123 ext. 0012.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8=""Checks whether the phone cell is empty.No, it has a phone
2IF(B8="", … "Review …")Flags an extension that has no phone number.Not used for row 8
3A8The phone number."(201) 555-0123"
4IF(B8="",""," ext. "&B8)Adds ext. and the extension, if there is one." ext. 0012"
5IF( … )Uses part 2 when the phone is empty, otherwise parts 3 and 4."(201) 555-0123 ext. 0012"

Read it left to right. A phone with no extension stays as it is. The numbers here are made-up.

=IF(A8="",IF(B8="","","Review extension without number"),A8&IF(B8="",""," ext. "&B8))

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 numbers. Paste phones and their extensions into the green columns of the Template tab. The labels fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Paste extensions as text, so an extension like 0012 keeps its zeros.

Microsoft's help: IF function