How to allow only alphanumeric, numeric, or text entries in Excel?
When a column is used for product codes, employee IDs, registration numbers, or similar records, allowing the wrong type of data can quickly create inconsistencies. Excel's Data Validation feature can restrict new entries to alphanumeric characters, numbers, or text values. If you need a simpler way to block special characters or clean existing data, Kutools for Excel also provides dedicated tools.
- Allow only alphanumeric characters with Data Validation
- Allow only numbers with Data Validation
- Allow only text values with Data Validation
- Prevent special characters with Kutools for Excel
- Remove non-alphanumeric characters with Kutools for Excel
- Frequently asked questions
| Method | Allowed or retained content | Works on | Setup |
|---|---|---|---|
| Data Validation – Alphanumeric | Letters and numbers | New entries | Requires a custom formula |
| Data Validation – Numbers | Numeric values | New entries | Requires a short formula |
| Data Validation – Text | Values Excel recognizes as text | New entries | Requires a short formula |
| Kutools – Prevent Typing | Letters and numbers; blocks special characters | New entries | Direct selection with no formula |
| Kutools – Remove Characters | Letters and numbers; removes other characters | Existing data | Bulk cleanup with preview |
Allow only alphanumeric characters with Data Validation
To restrict a column to letters and numbers, create a custom Data Validation rule as follows:
- Select the target cells or click the column header to select the entire column. Then go to Data > Data Validation > Data Validation.

- In the Data Validation dialog box, on the Settings tab, select Custom from the Allow list. Enter the following formula in the Formula box:
=AND(A1<>"",SUMPRODUCT(--ISNUMBER(FIND(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")))=LEN(A1))📝 Note:
Replace A1 with the first cell in your selected range. The reference should correspond to the active cell when the validation rule is created.

- Click OK. Excel will now reject entries containing characters that are not included in the formula's allowed character set.

📝 Note:
This rule affects new entries only; it does not clean values that are already in the cells.

Unlock Excel Magic with Kutools AI
- Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
- Custom Formulas: Generate tailored formulas to streamline your workflows.
- VBA Coding: Write and implement VBA code effortlessly.
- Formula Interpretation: Understand complex formulas with ease.
- Text Translation: Break language barriers within your spreadsheets.
Allow only numbers with Data Validation
If the selected cells should contain numeric values only, use the ISNUMBER function in a custom validation rule.
- Select the cells you want to restrict, and go to Data > Data Validation > Data Validation.
- On the Settings tab, select Custom from the Allow list, and enter the following formula:
=ISNUMBER(B1)Replace B1 with the first cell in the selected range.

- Click OK. Excel will accept numeric values and reject text entries.
📝 Note:
If entries such as phone numbers or IDs must retain leading zeros, a numbers-only rule may not be suitable because Excel can remove those zeros. Store those values as text and use an alphanumeric or character-based restriction instead.
Allow only text values with Data Validation
For names, categories, descriptions, or other fields that should be stored as text, use the ISTEXT function.
- Select the target cells, and go to Data > Data Validation > Data Validation.
- On the Settings tab, select Custom from the Allow list, and enter the following formula:
=ISTEXT(C1)Replace C1 with the first cell in the selected range.

- Click OK. Excel will accept entries stored as text and reject numeric values.
📝 Note:
This rule allows any value Excel recognizes as text, including text that contains numbers, spaces, or special characters. It does not limit input to alphabetic letters only.
Prevent special characters with Kutools for Excel
If your goal is specifically to block special characters, Kutools for Excel's Prevent Typing feature provides a quicker setup without a custom formula.
After installing Kutools for Excel, follow these steps:
- Select the cells you want to restrict. Then click Kutools > Prevent Typing > Prevent Typing.

- In the Prevent Typing dialog box, select Prevent type in special characters, and click OK. If confirmation dialogs appear, click Yes and then OK.




The selected cells will now reject special characters while continuing to accept letters and numbers.

📝 Note:
The Prevent Typing feature also lets you define specific characters that users are allowed or not allowed to enter, making it useful when the permitted character set is more specific.
Demo: Prevent special characters from being entered
Remove non-alphanumeric characters with Kutools for Excel
If the unwanted characters are already present, use Kutools for Excel's Remove Characters feature to clean the selected data in bulk. This method keeps letters and numbers while removing other characters.
After installing Kutools for Excel, follow these steps:
- Select the cells you want to clean. Then click Kutools > Text > Remove Characters.

- In the Remove Characters dialog box, select Non-alphanumeric. Check the result in the Preview pane before applying the change.

- Click OK or Apply. Kutools removes all non-alphanumeric characters from the selected strings.

📝 Note:
This method changes existing cell contents but does not restrict what users can enter later. Use Prevent Typing when you also need to control future entries.
Frequently asked questions
Why can users still paste invalid data into cells with Data Validation?
Excel's Data Validation mainly controls direct entry. Pasting data can overwrite or bypass the rule in some situations, so recheck the validation settings after users paste into protected ranges.
Does the alphanumeric rule allow spaces?
No. The formula's allowed character set contains letters and numbers only. To allow spaces, add a space inside the quoted character set in the formula.
Why are leading zeros removed from numeric entries?
Excel stores numeric values without insignificant leading zeros. For phone numbers, account numbers, or codes, format the cells as Text and use a validation rule designed for text-based entries.
Will these methods clean invalid characters already in the cells?
Data Validation and Prevent Typing control new entries; they do not clean existing data. Use the Kutools Remove Characters method to remove non-alphanumeric characters already present.
Why is Kutools not showing in Excel?
Kutools may not be installed, enabled, or loaded correctly. After installing it, go to File > Options > Add-ins and check whether it has been disabled. If necessary, restart Excel or reinstall Kutools.
Related articles
- How to remove empty sheets from a workbook?
- How to allow only Yes or No entries in Excel?
- How to remove all duplicates but keep one in Excel?
- How to remove the first or last N characters from a cell in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in












