How to Format Phone Numbers in Google Sheets: Strip Dashes and Spaces, Show (555) 010-1234, Handle +1 and Extensions, Then Find Duplicate Contacts (2026)
Phone numbers arrive in every shape: typed by hand, pasted from a CRM export, collected by a form. One contact is (555) 010-1234, the next is 555.010.2345, a third has +1 in front and a fourth ends in “ext. 12”. Besides looking untidy, this breaks lookups and duplicate checks, because to Google Sheets those are all different text. This guide cleans a phone column with built-in formulas, shows the result as (555) 010-1234, deals with +1, extensions, blanks and numbers that don’t fit, and then uses the clean column to find duplicate contacts.
The short answer
- Digits only:
=REGEXREPLACE(C2&"", "\D", "")turns (555) 010-1234, 555.010.1234 and 555 010 1234 into 5550101234. - Drop +1: if the result has 11 digits and starts with 1, keep
RIGHT(d,10). - Show it nicely:
="("&LEFT(D2,3)&") "&MID(D2,4,3)&"-"&RIGHT(D2,4)gives (555) 010-1234. Paste the result back as values when you are happy with it. - Find duplicate contacts: count repeats on the 10-digit column, not on the original one.
These recipes are for US and Canadian (North American) numbers, which have a 3-digit area code and 7 more digits. If your list mixes countries, read the international numbers section first.
The example
A contact list with ten rows. Rows 2 and 4 are the same person with different emails, rows 3 and 8 are the same number written two ways, row 5 was typed without punctuation (so Sheets stored it as a number), rows 6 and 10 share an office line with different extensions, row 9 is missing its area code, and two people left the phone blank.
| Row | A: Name | B: Email | C: Phone |
|---|---|---|---|
| 2 | Ana Ruiz | ana@example.com | (555) 010-1234 |
| 3 | Ben Cole | ben@example.com | 555.010.2345 |
| 4 | Ana Ruiz | ana.ruiz@example.com | +1 555-010-1234 |
| 5 | Cara Diaz | cara@example.com | 5550103456 (typed as a number) |
| 6 | Dev Shah | dev@example.com | 555-010-4567 ext. 12 |
| 7 | Eli Moss | eli@example.com | (blank) |
| 8 | Ben Cole | ben.c@example.com | 1 (555) 010-2345 |
| 9 | Fay Lin | fay@example.com | 010-5678 |
| 10 | Gus Hale | gus@example.com | 555 010 4567 x15 |
| 11 | Hana Wu | hana@example.com | (blank) |
The plan is three helper columns: D holds the 10 digits (the matching key), E the extension, and F the formatted number. You can delete D to F once the clean numbers are pasted back.
Step 1: keep only the digits
REGEXREPLACE replaces every part of the text that matches a regular expression. \D means “any character that is not a digit”, so replacing it with nothing strips spaces, dashes, dots, parentheses and the plus sign in one go:
=REGEXREPLACE(C2&"", "\D", "")
Why C2&"" and not just C2? Google’s REGEXREPLACE help page notes that the function only works with text input. Row 5 holds the number 5550103456, so REGEXREPLACE(C2, …) fails there. Joining an empty string with &"" turns the number into text first and leaves text unchanged.
Step 2: split off extensions, then drop the leading 1
Stripping non-digits from “555-010-4567 ext. 12” gives 555010456712, a 12-digit number that matches nothing. So remove the extension before stripping, and keep a US country code out of the key as well. Put this in D2 and fill down:
=LET(raw, C2&"",
main, REGEXREPLACE(raw, "(?i)\s*(x|ext\.?|extension)\s*\d+\s*$", ""),
d, REGEXREPLACE(main, "\D", ""),
IF(AND(LEN(d)=11, LEFT(d,1)="1"), RIGHT(d,10), d))
main is the number without a trailing x12, ext 12, ext. 12 or extension 12 ((?i) makes the match ignore letter case, so EXT and Ext work too). d is its digits. The last line drops the 1 from +1 555-010-1234 and 1 (555) 010-2345, which both have 11 digits starting with 1. Everything else passes through untouched.
To keep the extension, pull it into E2 with REGEXEXTRACT, which returns the part in parentheses:
=IFERROR(REGEXEXTRACT(C2&"", "(?i)(?:x|ext\.?|extension)\s*(\d+)\s*$"), "")
IFERROR returns an empty cell for rows without an extension, where REGEXEXTRACT finds no match.
Step 3: format as (555) 010-1234
With the 10 digits in D and the extension in E, put this in F2 and fill down:
=IF(LEN(D2)<>10, C2, "("&LEFT(D2,3)&") "&MID(D2,4,3)&"-"&RIGHT(D2,4)&IF(E2="", "", " x"&E2))
LEFT, MID and RIGHT cut the digits into area code, prefix and line number and glue the punctuation around them. The IF(LEN(D2)<>10, C2, …) part is the safety net: a blank cell stays blank, and a number that is not exactly 10 digits after cleaning (row 9, or a foreign number) is shown exactly as typed instead of being forced into the wrong shape. Here is the result:
| Row | C: Phone | D: Digits | E: Ext | F: Formatted | G: Same phone? |
|---|---|---|---|---|---|
| 2 | (555) 010-1234 | 5550101234 | (555) 010-1234 | Same phone | |
| 3 | 555.010.2345 | 5550102345 | (555) 010-2345 | Same phone | |
| 4 | +1 555-010-1234 | 5550101234 | (555) 010-1234 | Same phone | |
| 5 | 5550103456 | 5550103456 | (555) 010-3456 | ||
| 6 | 555-010-4567 ext. 12 | 5550104567 | 12 | (555) 010-4567 x12 | Same phone |
| 7 | (blank) | ||||
| 8 | 1 (555) 010-2345 | 5550102345 | (555) 010-2345 | Same phone | |
| 9 | 010-5678 | 0105678 | 010-5678 | ||
| 10 | 555 010 4567 x15 | 5550104567 | 15 | (555) 010-4567 x15 | Same phone |
| 11 | (blank) |
To find the rows that need a human, add a check column:
=IF(AND(C2<>"", LEN(D2)<>10), "Check", "")
Only row 9 is flagged: 010-5678 has 7 digits, so the area code is missing and no formula can guess it.
All in one formula
If you would rather not keep helper columns, this does steps 1 to 3 for the whole range in one cell (adjust C2:C11 to your data):
=MAP(C2:C11, LAMBDA(p, LET(raw, p&"",
ext, IFERROR(REGEXEXTRACT(raw, "(?i)(?:x|ext\.?|extension)\s*(\d+)\s*$"), ""),
d0, REGEXREPLACE(REGEXREPLACE(raw, "(?i)\s*(x|ext\.?|extension)\s*\d+\s*$", ""), "\D", ""),
d, IF(AND(LEN(d0)=11, LEFT(d0,1)="1"), RIGHT(d0,10), d0),
IF(LEN(d)<>10, p, "("&LEFT(d,3)&") "&MID(d,4,3)&"-"&RIGHT(d,4)&IF(ext="", "", " x"&ext)))))
MAP runs the LAMBDA once for each cell in the range, so every row gets the same treatment as the three helper columns above.
Replace the original numbers
Formulas recalculate from column C, so to make the cleanup permanent, select F2:F11, copy, click C2 and use Edit › Paste special › Values only. Then delete the helper columns. Do this on a copy of the tab first if the list matters (right-click the tab and choose Duplicate).
Alternative: keep numbers as numbers and use a custom number format
If every phone is a plain 10-digit number, you can leave the values alone and change only how they look. Turn the cleaned digits into real numbers with
=IF(LEN(D2)=10, VALUE(D2), "")
paste them as values, select the column and choose Format › Number › Custom number format. Enter this pattern and click Apply:
"("000") "000"-"0000
In Google’s number format help page, 0 stands for a digit that is always shown and text in double quotes is added as typed, so 5550103456 is displayed as (555) 010-3456 while the cell still holds the number. That is handy for sorting, but it has limits: a format cannot show an extension, it does nothing to cells that hold text, and any formula that reads the cell sees 5550103456, not the formatted text. For a contact list you plan to export or mail-merge, the text version from Step 3 is usually the safer choice.
International numbers
Everything above assumes North American numbers. Other countries use different lengths and groupings, and their leading 0 or + matters. Three practical rules:
- Don’t run the US recipe on them. The formulas leave numbers that don’t clean to 10 digits as typed, but a foreign number that happens to have 10 digits would be reshaped wrongly. If your list mixes countries, add a Country column and apply the formulas only to US and Canadian rows, for example by wrapping the F2 formula in
IF(H2="US", …, C2)where H holds the country. - Store them with + and the country code. For matching, the digits-only key from Step 1 (without the leading-1 rule) still works across formats as long as everyone wrote the country code the same way.
- Type or paste them into plain-text cells. Format the column with Format › Number › Plain text before entering numbers, so Sheets keeps a leading 0 or + exactly as typed instead of treating the entry as a number.
Step 4: use the clean column to find duplicate contacts
Now that every number has one spelling, duplicates are easy to see. Flag every row whose number appears more than once (G2, filled down):
=IF(D2="", "", IF(COUNTIF($D$2:$D, D2)>1, "Same phone", ""))
Rows 2 and 4 (Ana, two different emails), rows 3 and 8 (Ben) and rows 6 and 10 (the shared office line) are flagged. The D2="" test keeps the two blank phones from matching each other; the ignore blank cells guide explains why that matters. To mark only the later copies, so the first row of each group stays unmarked, use a running range instead:
=IF(D2="", "", IF(COUNTIF($D$2:D2, D2)>1, "Duplicate", ""))
To color whole rows instead, select A2:G, choose Format › Conditional formatting, pick Custom formula is and enter:
=AND($D2<>"", COUNTIF($D$2:$D, $D2)>1)
Decide whether the extension is part of the identity
Dev (ext. 12) and Gus (x15) share an office number, but they are different people. If extensions separate people in your list, match on a key that includes it:
=IF(D2="", "", D2&IF(E2="", "", "x"&E2))
With this key in column H, only rows 4 and 8 are later copies. In general, a shared number (an office switchboard, a family landline) is a hint, not proof, so review flagged rows with the name and email before you delete anything.
Remove the duplicates
Paste the key column as values (Edit › Paste special › Values only), sort so the row you want to keep comes first, then select the table and choose Data › Data cleanup › Remove duplicates, ticking only the key column. It keeps the first row of each group. Blank keys count as equal to each other, so in this example it would also delete Hana’s row as a “duplicate” of Eli’s: give blank rows their own key first, as shown in the ignore blank cells guide, or remove those rows by hand from a filtered view. If two copies hold different details (one has the email, the other the address), merge the rows instead of deleting one.
Keep new entries clean
To nudge people toward the clean format going forward, select C2:C, choose Data › Data validation, then Add rule, choose Custom formula is and enter:
=OR(C2="", REGEXMATCH(C2&"", "^\(\d{3}\) \d{3}-\d{4}( x\d+)?$"))
Under Advanced options, choose Show a warning rather than Reject the input, so a pasted or foreign number is still accepted but gets a red marker. For the setup details, see the prevent duplicate entries guide.
Common problems
- An error from REGEXREPLACE. The cell holds a number. Use
C2&""inside the formula as shown. - A 12-digit or longer result. An extension or a second number in the same cell (“555-010-1234 / 555-010-2345”) was glued together. Split extensions with Step 2 and second numbers into their own column.
- Leading zeros disappeared. The column was a number column when the data went in. Format it as Plain text and paste the data again, or keep the formatted text version from Step 3.
- The formatted column shows the old value. That is the safety net: after cleaning, the number is not 10 digits. Check it by hand.
- Duplicates still not found. Compare on column D (digits), not on C or F, and make sure the same contact isn’t also stored with a different number.
FAQ
How do I format phone numbers in Google Sheets?
Clean first, then format. Keep only the digits with =REGEXREPLACE(C2&"", "\D", ""), drop a leading country code 1 when there are 11 digits, and build the display version with ="("&LEFT(D2,3)&") "&MID(D2,4,3)&"-"&RIGHT(D2,4). If the numbers are already plain 10-digit numbers, you can instead keep them as numbers and apply Format › Number › Custom number format with the pattern "("000") "000"-"0000.
How do I remove dashes, spaces, dots and parentheses from phone numbers in Google Sheets?
Use =REGEXREPLACE(C2&"", "\D", ""). \D matches any character that is not a digit, so (555) 010-1234, 555.010.1234 and 555 010 1234 all become 5550101234. The &"" turns a cell that holds a number into text first, because REGEXREPLACE only accepts text.
Why does REGEXREPLACE give an error on some phone numbers?
A phone number typed without punctuation, such as 5550103456, is stored as a number, and REGEXREPLACE only works with text input. Write C2&"" instead of C2 inside the formula and the error goes away.
How do I handle +1 and a leading 1 on US phone numbers?
After keeping only the digits, a US number with its country code has 11 digits starting with 1. =IF(AND(LEN(d)=11, LEFT(d,1)="1"), RIGHT(d,10), d) keeps the last 10 digits in that case and leaves everything else alone, so +1 555-010-1234 and 1 (555) 010-1234 end up the same as (555) 010-1234.
How do I keep phone extensions like ext. 12 or x12?
Split the extension off before you strip non-digits, or its digits are glued onto the number. =IFERROR(REGEXEXTRACT(C2&"", "(?i)(?:x|ext\.?|extension)\s*(\d+)\s*$"), "") returns just the extension, and the formatted number can add it back as " x12".
How do I find duplicate contacts by phone number in Google Sheets?
Compare the cleaned 10-digit column, not the original one. With the digits in D, =IF(D2="", "", IF(COUNTIF($D$2:D2, D2)>1, "Duplicate", "")) marks every later copy, and the conditional formatting rule =AND($D2<>"", COUNTIF($D$2:$D, $D2)>1) highlights all rows that share a number. Skip blank phone cells, and review shared lines such as an office main number before deleting anything.
Install free from Google Workspace MarketplaceSee SheetDupes
Want to test it first? Try it on sample data (makes a copy of a 12-row example sheet in your Drive).
Related guides
- Duplicates That Don’t Match Exactly in Google Sheets: Case, Extra Spaces, Gmail Dots, Phone Formats and Typos (2026)
- How to Find and Remove Duplicates in Google Sheets: Highlight, Count, Delete and Keep the Original (2026)
- How to Highlight Duplicates in Google Sheets: Conditional Formatting Formulas for One Column, Whole Rows, Repeats Only and Two Sheets (2026)
- How to Compare Two Columns or Two Sheets in Google Sheets to Find Matches and Duplicates (2026)
- How to Remove Duplicates in Google Sheets but Keep the Latest, First or Highest Row per Key (2026)
- How to Prevent Duplicate Entries in Google Sheets: Data Validation Rules, Warnings and a Small Script (2026)
- How to Count Duplicates in Google Sheets: per Value, Extra Rows, Unique Counts and Why the Numbers Disagree (2026)
- How to Combine Two Lists or Several Tabs in Google Sheets Without Duplicates: VSTACK, UNIQUE, One Row per Key and Other Files (2026)
- How to Merge Duplicate Rows in Google Sheets: Sum the Numbers, Join the Notes and Fill the Blanks (2026)
- UNIQUE vs Remove Duplicates in Google Sheets: Live or Static, Letter Case, Spaces, Columns and Headers (2026)
- How to Remove Duplicates Within a Cell in Google Sheets: Comma-Separated Lists, Tags, Line Breaks and Letter Case (2026)
- How to Show Only the Duplicates in Google Sheets: Filter Duplicate Rows, List Repeated Values and Find Rows That Appear Once (2026)
- How to Find Duplicates Across Multiple Columns in Google Sheets: Rows That Match on Two or More Columns, and Values Repeated Anywhere in a Range (2026)
- How to Remove Duplicates Automatically in Google Sheets: Apps Script on a Daily Timer, on Form Submit or From a Menu (2026)
- How to Find Duplicate Transactions in Google Sheets: Double-Imported Rows, Invoices Paid Twice and Same-Amount Charges Within a Few Days (2026)
- How to Find Duplicates in Google Sheets but Ignore Blank Cells: Highlight, Count, List and Remove Without Empty Rows Getting in the Way (2026)
- How to Change Text Case in Google Sheets: UPPERCASE, lowercase, Proper Case Names, Sentence Case and Duplicates That Differ Only in Case (2026)