Add an area code to a seven-digit phone
Turn 5550123 and 201 into 2015550123, using the area code you were given.
What you'll make

The formula

| Number | Part | What it does | Result so far |
|---|---|---|---|
| 1 | AND(LEN(A8)=7,LEN(B8)=3) | Checks for 7 digits and a 3-digit area code. | Yes |
| 2 | B8&A8 | Puts the area code in front of the number. | "2015550123" |
| 3 | "Review number parts" | What the cell says for any other lengths. | Not used for row 8 |
| 4 | IF( … ) | Uses part 2 when part 1 says yes, otherwise part 3. | "2015550123" |
The result is text, so no digits are lost. The numbers here are made-up.
=IF(AND(LEN(A8)=7,LEN(B8)=3),B8&A8,"Review number parts")How to use it
Yellow bar at the top? Click Enable Editing.
- See it work. The Example tab shows 20 made-up examples with the formula already in.
- Use your own numbers. Paste seven-digit numbers and their area codes into the green columns of the Template tab. The full numbers fill in by themselves.
- Move them into your letter. Copy the results. Then use Paste Special and choose Values.
Before you send
Paste the seven digits without a dash. Use only the area code your records give for that person.
Microsoft's help: Using IF with AND, OR and NOT
OTHER ROUTES YOU MIGHT LIKE

Drop a national prefix when one is given
02079460123 + 0 → 2079460123
Get the template →
Replace a given dialing prefix with a plus
0012015550123 + 00 → +12015550123
Get the template →
Write a local tel: link with phone context
7042 + example.com → tel:7042;phone-context=example.com
Get the template →
Hide "Phone:" when there's no phone number
(blank) → no "Phone:" line
Take this route →