How to Make Phone Numbers Look Nice in Excel

excel-phone-number-formatting-header

Do you work with phone numbers in Excel? Sometimes, they might look a bit messy, right? Imagine seeing 1234567890 instead of a clear (123) 456-7890. Making your phone numbers look neat and tidy can help you read your data much better!

In this easy guide, we will learn different ways to format phone numbers in Excel. We will start with simple tricks for clean numbers and then move to smart formulas for numbers that are a bit messy, like those with extra spaces or extensions. Let’s make your Excel sheets look super professional!

Method 1: Using Custom Number Formatting (For Clean Numbers)

This method is perfect when your phone numbers are already clean, simple numbers in Excel. It helps you change how they look without changing the actual number stored in the cell.

  1. Select Your Numbers: First, pick all the cells that have the phone numbers you want to format.
  2. Open Format Cells: Press Ctrl + 1 on your keyboard. This will open a small window called “Format Cells”.
  3. Go to Custom: In the “Format Cells” window, click on the “Number” tab. Then, from the list on the left, choose “Custom”.
  4. Type the Format: In the box that says “Type:”, clear anything that’s there and carefully type this code: (###) ###-####
  5. Click OK: Click the “OK” button.

custom-number-format-clean-data

Why this works:
The (###) ###-#### code tells Excel how to display your numbers.
The (, ), space, and - are shown exactly as you type them.
Each # stands for a digit from your phone number.
So, if you have 5551234567, Excel will show it as (555) 123-4567. Remember, this only changes how you see the number, not the number itself.

Other cool formats you can try:
To add a country code like +1: +1 (###) ###-####
To use dots instead of hyphens: ###.###.####

Method 2: Using Conditional Custom Number Formatting (For 7 & 10 Digit Numbers)

Sometimes, you might have a mix of phone numbers, some with 7 digits and some with 10 digits. This method helps you format both types correctly at the same time!

  1. Select Your Numbers: Highlight all the cells that contain your phone numbers.
  2. Open Format Cells: Press Ctrl + 1 to open the “Format Cells” window.
  3. Go to Custom: Click on the “Number” tab, then choose “Custom”.
  4. Type the Special Format: In the “Type:” box, enter this code: [>9999999](###) ###-####;###-####
  5. Click OK: Hit the “OK” button.

conditional-custom-format-7-10-digits

Why this works:
This is a smart format with two parts, separated by a semicolon ;.
[>9999999](###) ###-####: This part says: “If the number is bigger than 7 digits (meaning it’s a 10-digit number), show it as (123) 456-7890.”
;###-####: This second part says: “For all other numbers (which are 7-digit numbers), show them as 123-4567.”
This way, Excel automatically picks the right format for each number!

Method 3: Using TEXT Function (For Phone Numbers in Text Format)

What if your phone numbers are stored as text? You might see them aligned to the left in the cell, or they might have a small green triangle in the corner. Custom formatting won’t work here. No worries! The TEXT function comes to the rescue.

Here’s how to use it:

For the basic (###) ###-#### look:
In an empty cell next to your phone numbers, type this formula and press Enter:
=TEXT(A2,"(###) ###-####")
(Change A2 to the first cell with your phone number.)

To add a country code like +1:
Use this formula:
=TEXT(A2,"+1 (###) ###-####")

You can then drag this formula down to format all your phone numbers.

text-function-phone-number-format

Why this works:
The TEXT function is like a magic helper! It takes your phone number (even if it’s text) and then applies the specific format you tell it to. The format code (like "(###) ###-####") must always be inside double quotes. This turns your text number into a nicely formatted text string.

Method 4: Formatting Phone Numbers of Varying Length (Removing Extra Spaces or Codes)

Sometimes, your phone numbers might have extra spaces or even a country code that you want to remove, and then format the last 10 digits. This method uses a clever formula to clean and format them.

Here’s a formula that cleans spaces and takes the last 10 digits:

To get only the last 10 digits and format them:
=TEXT(RIGHT(SUBSTITUTE(A2," ",""),10),"(###) ###-####")

To add a country code +1 after cleaning:
=TEXT(RIGHT(SUBSTITUTE(A2," ",""),10),"+1 (###) ###-####")

varying-length-phone-number-format

Why this works:
This formula does a few things step by step:
1. SUBSTITUTE(A2," ",""): First, it removes all the spaces from your phone number. It replaces every space with nothing.
2. RIGHT(...,10): After removing spaces, it looks at the cleaned number and takes only the last 10 digits. This is great for removing any unwanted country codes or extra numbers at the start.
3. TEXT(...,"(###) ###-####"): Finally, it takes those last 10 digits and applies your chosen phone number format, just like we learned in Method 3.

Method 5: Formatting Messy Phone Number Data (with Spaces, Dots, Hyphens, Text)

What if your phone numbers are really messy? They might have dots, hyphens, or even words mixed in! For these tricky cases, Excel’s new REGEX functions (available in Microsoft 365) are super helpful.

Here’s a powerful formula to clean up really messy phone numbers:

To extract only digits and format them:
=TEXT(RIGHT(REGEXREPLACE(A2,"D",""),10),"(###) ###-####")

regex-replace-messy-data

Why this works:
Let’s break down this smart formula:
1. REGEXREPLACE(A2,"D",""): This is the magic part! D is a special code that means “any character that is not a digit (0-9)”. So, this part finds all the non-digit characters in your messy cell and replaces them with nothing, leaving only the pure numbers.
2. RIGHT(...,10): Once we have only digits, this takes the last 10 digits.
3. TEXT(...,"(###) ###-####"): Finally, it formats those 10 digits into your desired phone number look.

Method 6: Formatting Messy Phone Number Data (with Extension)

If your phone numbers have extensions (like “ext 123” or “x 45”), you might want to separate the main number from the extension. This method uses TEXTBEFORE and TEXTAFTER functions to do just that!

Here are the formulas:

To get the extension:
=IFERROR(TRIM(TEXTAFTER(A2,{"ext";"x";"extension"})),"")

To get the main phone number and format it:
=TEXT(RIGHT(REGEXREPLACE(IFERROR(TRIM(TEXTBEFORE(A2,{"ext";"x";"extension"})),A2),"D",""),10),"(###) ###-####")

textbefore-after-extensions

Why this works:
This method is like having two helpers:
For the Extension: TEXTAFTER(A2,{"ext";"x";"extension"}) looks for “ext”, “x”, or “extension” and gives you whatever comes after it. TRIM cleans up extra spaces, and IFERROR makes sure you don’t see errors if there’s no extension.
For the Main Number: TEXTBEFORE(A2,{"ext";"x";"extension"}) does the opposite – it gives you whatever comes before “ext”, “x”, or “extension”. If there’s no extension, IFERROR makes sure it uses the original cell content. Then, REGEXREPLACE, RIGHT, and TEXT work together (just like in Method 5) to clean and format the main 10-digit number.

Important Things to Remember (Common Mistakes)

  • Numbers vs. Text: Custom number formatting only works for numbers. If your phone numbers are text (usually left-aligned in Excel), you need to convert them to numbers first or use the TEXT function or other formula methods.
  • Appearance vs. Value: Custom formatting changes how a number looks, but not its actual value. So, (123) 456-7890 might look nice, but Excel still sees it as 1234567890 in the background.
  • REGEX Functions: The REGEXREPLACE, REGEXEXTRACT, and REGEXTEST functions are new. They only work in Excel for Microsoft 365 and Excel on the web. If you have an older version of Excel, these formulas might not work for you.

Conclusion

Great job! You now know many ways to format phone numbers in Excel. Whether your data is clean and simple, or messy with extra characters and extensions, you have the tools to make it look perfect. Keeping your phone numbers neat makes your spreadsheets easier to read and understand.

Keep practicing these methods, and soon you’ll be a pro at making your Excel data shine! If you have any questions, feel free to ask. Happy Excelling!