logo
search
Others

How to Enforce 10-Digit Unique Phone Numbers in Excel using Data Validation

Natalie TaylorNatalie Taylor Oct 21, 2026 868 views

Question details

The user needs to restrict Excel cell inputs to exactly 10-digit unique phone numbers while preserving leading zeros.

How to Enforce 10-Digit Unique Phone Numbers in Excel using Data Validation
Product
Microsoft Excel
Device & OS
not provided
Scenario
Entering phone number data into a spreadsheet and needing to ensure data accuracy by preventing duplicates and enforcing a strict 10-character limit.
Observed behavior
Standard validation rules struggle to simultaneously enforce character count, numeric-only text, and uniqueness, particularly when dealing with leading zeros.
Before you start

Before applying validation rules, ensure the target column is formatted as Text to prevent Excel from dropping leading zeros from the entered phone numbers.

Solution 1Recommended

Apply a Custom Data Validation Formula

Use a combined formula in the Data Validation tool to enforce length, numeric content, and uniqueness all at once.

Phone numbers are best stored as text in Excel to preserve leading zeros. A custom validation formula using AND, LEN, ISNUMBER, and COUNTIF can enforce all three requirements (10 digits, numbers only, no duplicates) simultaneously.

1
Format Column as Text

Select the entire column where you will enter phone numbers. Go to the Home tab, click the Number Format dropdown, and select 'Text'.

2
Open Data Validation

Keep the column selected, navigate to the Data tab on the ribbon, and click on 'Data Validation'.

3
Enter the Custom Formula

In the Settings tab, change the 'Allow' dropdown to 'Custom'. In the Formula box, enter: =AND(LEN(A2)=10,ISNUMBER(--A2),COUNTIF($A:$A,A2)=1). Click OK to apply.

Apply a Custom Data Validation Formula
Adjust Cell References: If your data starts in a different cell, adjust 'A2' in the formula to match the first active cell in your selected range, and '$A:$A' to match your exact column letter.
Manage Spreadsheets with WPS Office

Easily Validate Phone Numbers in WPS Spreadsheet

WPS Spreadsheet provides powerful Data Validation and Conditional Formatting tools fully compatible with Microsoft Excel formulas. You can easily enforce 10-digit unique phone number rules to keep your data clean and accurate.

  1. 1. Format as Text: Open your worksheet in WPS Spreadsheet, select the phone number column, right-click to choose 'Format Cells', and set the category to 'Text'.
  2. 2. Open Validation Tool: Go to the 'Data' tab on the top ribbon and click on 'Validation'.
  3. 3. Apply Custom Formula: Choose 'Custom' from the Allow dropdown and input the formula =AND(LEN(A2)=10,ISNUMBER(--A2),COUNTIF($A:$A,A2)=1).
  4. 4. Confirm Rule: Click 'OK' to apply the rule and immediately prevent incorrect or duplicate phone number entries.
Fully compatible with Microsoft Excel custom formulas like COUNTIF and LENIntuitive Data Validation menu to prevent duplicate and invalid entriesFree, lightweight, and easy to use across Windows, Mac, and mobile
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel remove the leading zero from my phone numbers?

Excel treats numbers with leading zeros as standard integers and automatically removes the zero to save space. To prevent this, format the cells as Text before entering the phone numbers or type an apostrophe (') before the number.

Can I use standard data validation for text length instead of a custom formula?

Yes, you can use the 'Text length' option in Data Validation to ensure exactly 10 characters. However, this built-in option alone cannot simultaneously check for uniqueness and numeric-only characters, which is why a custom formula is highly recommended.

How do I fix validation rules if my data starts in cell B5?

If your selected range starts at B5, adjust your custom validation formula to reference B5 instead of A2. For example, your formula should be: =AND(LEN(B5)=10,ISNUMBER(--B5),COUNTIF($B:$B,B5)=1).

Does data validation apply to pasted data?

By default, standard copy-pasting into Excel can overwrite data validation rules. To maintain the rules while pasting data from another source, use 'Paste Special' and select 'Values' so the destination formatting and validation remain intact.