Phone numbers

How to Fix Phone Numbers in Excel: Format and Country Codes

By the DecodingPro teamUpdated 6 min read

Quick answer

Store phone numbers as text, never as numbers, in the international E.164 form: a plus sign, the country code and the national number, digits only, at most 15 digits in total (for example +919876543210). Remove spaces, brackets and hyphens, drop the national trunk prefix where the country uses one (the leading 0 in the UK, for example), and add a country code only when you know the country. Excel can reshape numbers; it cannot tell you whether a number is valid in its country.

A phone number is an identifier, not a quantity, and that one fact explains most of the trouble. Excel loves to treat anything made of digits as a number: it drops leading zeros, switches long values to scientific notation and cuts off digits beyond fifteen. This guide shows how to keep numbers intact, how to clean the formats people type, how to add country codes safely, and how to check the result.

Why phone numbers get damaged

What you seeWhat happened
7700900123 instead of 07700900123Excel read the cell as a number and dropped the leading zero. That information is gone from the cell.
9.19877E+11The value was long enough that Excel switched to scientific notation in General format. The digits may still be stored; the display is the problem.
1234567890123450 instead of 1234567890123456A number longer than 15 digits was typed or pasted into a numeric cell. Excel keeps 15 significant digits (Microsoft documents this limit) and replaces the rest with zeros. That damage cannot be undone.
(212) 555-0147, 212.555.0147, 212 555 0147People wrote the same number three ways. Duplicates and matches will fail until you normalize them.
A number with no country codeIt was entered for local use. Anyone outside that country cannot dial it, and an SMS service will reject it.
Prevention beats repair. Set the column format to Text (Ctrl+1, Text) before pasting or typing numbers, and when opening a CSV use Data, From Text/CSV and set the phone column to Text in the preview. Once a leading zero or a 16th digit is lost, only the original source can restore it.

The target format: E.164

E.164 is the international numbering plan from the ITU. A conforming number contains only digits, at most fifteen, made of a country code (one to three digits) followed by the national number. Written for software, it is prefixed with a plus sign:

Written locallyE.164Notes
07700 900123 (UK)+447700900123Drop the leading trunk 0 and add 44. 07700 900000 to 900999 is a range Ofcom reserves for drama use, handy for examples.
98765 43210 (India)+919876543210Indian mobile numbers have 10 digits; add 91.
(212) 555-0147 (US/Canada)+12125550147North American numbers have 10 digits after the country code 1. The 555-01xx block is reserved for fiction.
0033 6 12 34 56 78+33612345678"00" is a common international call prefix; replace it with +.

Why bother with one format? Messaging and calling services (SMS and WhatsApp APIs, for example) expect E.164, CRMs use it to detect duplicates, and a number in E.164 is unambiguous anywhere in the world.

Step 1: Keep what you have

  1. Copy the sheet. Keep the original phone column untouched.
  2. Format the working column as Text before you paste into it.
  3. If numbers already lost zeros, check the source. Restoring them yourself is guesswork unless every number is known to have the same length (for example =TEXT(A2,"0000000000") for a fixed 10-digit format).
  4. For ZIP and postal codes, the same rule applies: =TEXT(A2,"00000") restores five-digit US ZIP codes whose zero was lost.

Step 2: Strip everything except digits and the plus

Move any extensions out of the way first (see below), because stripping non-digits would glue an extension such as "x123" onto the main number. Then, with Microsoft 365, which now includes regular-expression functions, one formula does it:

=REGEXREPLACE(A2,"[^0-9+]","")

In older versions, nest SUBSTITUTE calls, one per character you want to remove:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2," ",""),"-",""),"(",""),")",""),".","")

Also remove the non-breaking space with SUBSTITUTE(A2,CHAR(160),"") if the data came from a web page. Convert a leading "00" to "+":

=IF(LEFT(B2,2)="00","+"&MID(B2,3,20),B2)

Step 3: Add the country code only when you know the country

This is where cleaning becomes risky. A ten-digit string can be an Indian mobile number, a US or Canadian number, or something from elsewhere, and nothing in the digits says which. A formula that adds +91 or +1 to everything creates wrong numbers that look right. Use these formulas only on a column where every row is from one known country, or add a country column and apply the rule per row.

Everyone inFormula (digits already in B2)
India (10-digit mobile)=IF(LEFT(B2,1)="+",B2,"+91"&RIGHT(B2,10))
United States or Canada=IF(LEFT(B2,1)="+",B2,"+1"&RIGHT(B2,10))
United Kingdom (national format with 0)=IF(LEFT(B2,1)="+",B2,IF(LEFT(B2,1)="0","+44"&MID(B2,2,20),B2))

Numbers that already start with a plus are left alone. After applying a formula, copy and Paste Special as Values, and set the column to Text.

Step 4: Validate, honestly

Excel can check the shape of a number. In Microsoft 365 a regular expression is the strictest test (a plus sign, then 7 to 15 digits):

=REGEXTEST(B2,"^\+[0-9]{7,15}$")

In older versions use a length test, which is looser because converting text to a number also accepts forms such as 1E3:

=AND(LEFT(B2,1)="+",LEN(B2)>=8,LEN(B2)<=16,ISNUMBER(--MID(B2,2,20)))

Either confirms a plus sign and a plausible length (E.164 allows at most 15 digits, so up to 16 characters with the plus). It does not tell you whether the number exists in its country's numbering plan. Each country has its own rules for length and valid starting digits, and they change over time. The standard solution is Google's open-source libphonenumber library, which holds the metadata for every country and is used by Android and many applications to parse, format and validate numbers. If you validate by formula alone, a plausible but impossible number passes.

Extensions, multiple numbers and letters

  • Extensions (+14155550100 x123) are not part of E.164. Move them into their own column, for example =IFERROR(MID(A2,SEARCH("x",A2)+1,10),""), before stripping non-digits from the main number.
  • Two numbers in one cell ("+4477... / +4477...") should become two columns or two rows. Text to Columns with the slash as delimiter does it.
  • Letters such as 1-800-FLOWERS are keypad spellings. Convert them with the keypad mapping (A-C=2, D-F=3, ...) or flag them for a person.
  • Labels like "Mob:", "Tel." and "Phone" should be removed in step 2.
Phone numbers are one of the hardest fields to clean by formula.

DecodingPro normalizes phone numbers using metadata derived from libphonenumber, the same library family used across mobile platforms, converts them to international format when the country is clear, and flags the ones it cannot place instead of guessing a country. Every change is logged. Test it free with 100 credits.

Clean a file free

Storage versus display

Store one clean value (E.164) and format it for people only where it is shown. A spreadsheet that mixes storage and display ends up with +91 98765 43210 in one row and 09876543210 in the next. If you need a readable column, keep it separate from the column your systems use.

Phone number checklist

  1. Column set to Text before data goes in.
  2. Original column preserved.
  3. Symbols, spaces and labels stripped; "00" turned into "+".
  4. Trunk "0" removed when a country code is added.
  5. Country code added only where the country is known.
  6. Length and shape checked; impossible numbers flagged, not "repaired".
  7. Extensions and second numbers moved to their own columns.
  8. One stored format (E.164), duplicates checked after normalizing.

Frequently asked questions

How do I keep the leading zero in Excel?

Format the cells as Text before entering or pasting the number, or type an apostrophe before it. When importing a CSV, set the column to Text in the import preview. If the zero is already gone, restore it from the source file.

How do I stop phone numbers turning into 9.19E+11?

Format the column as Text before entering the data. If a number is already displayed that way, widening the column or changing the format to Number with no decimals usually reveals the digits, provided it has 15 digits or fewer.

What is the international phone number format?

E.164: a plus sign, the country code and the national number, digits only, with no more than 15 digits in total. For example +447700900123 for a UK mobile number written locally as 07700 900123.

How do I add a country code to many phone numbers in Excel?

If every number is from one country, use a formula that adds the code and removes the national leading zero. For mixed lists, add a country column first. Never apply one country code to a mixed list.

Can Excel validate phone numbers?

Only their shape: plus sign, digits and length. To check whether a number is valid for its country you need numbering-plan data, which libphonenumber provides.

Sources

  1. E.164: the international public telecommunication numbering plan (digits only, maximum fifteen)
  2. Google libphonenumber: parsing, formatting and validating international phone numbers
  3. Microsoft: Excel specifications and limits (15-digit number precision)
  4. Microsoft 365 Insider blog: Regular expression (REGEX) functions in Excel
  5. Ofcom: telephone numbers for drama use

Keep reading

01Excel data cleaningHow to Clean Messy Excel Data: A Step-by-Step GuideThe fixed order that stops one fix from undoing another, with the formulas for every step.10 min read02Text and numbersHow to Keep Leading Zeros in Excel and CSV (ZIP Codes, IDs)Why Excel turns 02134 into 2134, how to get the zeros back, and how to stop it happening when you open a CSV.5 min read03CSV and importsHow to Clean a CSV File Before Importing It Into a CRMSeven fixes that prevent duplicate contacts, rejected rows and scrambled characters, and the 10-row test to run first.4 min read04DatesHow to Fix Dates in Excel and CSV Files (Mixed Formats)Text dates, day-month swaps, two-digit years and the one rule that makes dates safe to share.8 min read06DuplicatesHow to Remove Duplicates in Excel Without Losing DataExact, near and partial duplicates: decide what counts, mark before you delete, keep the best record.6 min read07DuplicatesHow to Find and Highlight Duplicates in ExcelFind repeats safely first: highlight them, count them, keep the first one, and spot the near-duplicates Excel does not see.3 min read08NamesHow to Standardize Names in Excel: Proper Case and ExceptionsWhat PROPER gets wrong, how to protect names that are already right, and how to flip "Smith, John" into "John Smith".4 min read09Email addressesHow to Fix Email Typos in Excel: gmial.com, .con and Missing @The typos that make campaigns bounce, and the formulas and checks that fix them without guessing.4 min read10Email addressesHow to Clean an Email List Before You Send a CampaignA five-step routine that removes the avoidable bounces from a list without deleting anyone you should keep.3 min read11NamesHow to Split Full Names into First and Last Name in ExcelFlash Fill, Text to Columns and formulas for splitting names, and the names that trip each one up.4 min read12Text cleanupHow to Remove Extra Spaces in Excel (TRIM, CLEAN and Non-Breaking Spaces)Why TRIM sometimes does nothing, and the one formula that removes every kind of stray space.3 min read13Text cleanupHow to Remove Special Characters and Line Breaks in ExcelThe characters you cannot see, the smart quotes you can, and the exact formula or shortcut that removes each one.4 min read14NumbersHow to Convert Text to Numbers in Excel (Numbers Stored as Text)Why sums show zero, why numbers sit on the left, and four ways to turn text back into real numbers.3 min read15Excel data cleaningHow to Clean Data with Power Query in Excel (Step by Step)Record your cleaning steps once and replay them on every new file, without formulas and without touching the original data.4 min read16Comparing dataHow to Compare Two Lists in Excel and Find What Is MissingFind the names, IDs or emails that are in one list and not the other, with formulas that scale.3 min read17CSV and importsFix Garbled Characters and Broken CSV Imports (UTF-8)UTF-8, delimiters, leading zeros, quotes and a checklist that makes a file safe to import.7 min read18Data entryData Entry Accuracy: How to Check, Measure and Improve ItWhat the research says about error rates, why proofreading fails and the checks that actually work.9 min read