KutoolsforOffice — One Suite. Five Tools. Get More Done.

How to allow only alphanumeric, numeric, or text entries in Excel?

AuthorSunLast modified

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.

MethodAllowed or retained contentWorks onSetup
Data Validation – AlphanumericLetters and numbersNew entriesRequires a custom formula
Data Validation – NumbersNumeric valuesNew entriesRequires a short formula
Data Validation – TextValues Excel recognizes as textNew entriesRequires a short formula
Kutools – Prevent TypingLetters and numbers; blocks special charactersNew entriesDirect selection with no formula
Kutools – Remove CharactersLetters and numbers; removes other charactersExisting dataBulk 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:

  1. Select the target cells or click the column header to select the entire column. Then go to Data > Data Validation > Data Validation.
    Opening Data Validation from the Data tab in Excel
  2. 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.

    Creating a custom Data Validation rule for alphanumeric entries
  3. Click OK. Excel will now reject entries containing characters that are not included in the formula's allowed character set.
    Excel warning that an invalid entry is not allowed

📝 Note:

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

a screenshot of kutools for excel ai

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.
Enhance your Excel capabilities with AI-powered tools. Download Now and experience efficiency like never before!

Allow only numbers with Data Validation

If the selected cells should contain numeric values only, use the ISNUMBER function in a custom validation rule.

  1. Select the cells you want to restrict, and go to Data > Data Validation > Data Validation.
  2. 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.

    Creating a Data Validation rule that allows numbers only
  3. 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.

  1. Select the target cells, and go to Data > Data Validation > Data Validation.
  2. 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.

    Creating a Data Validation rule that allows text values only
  3. 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.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Integrated with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After installing Kutools for Excel, follow these steps:

  1. Select the cells you want to restrict. Then click Kutools > Prevent Typing > Prevent Typing.
    Opening the Prevent Typing feature in Kutools for Excel
  2. In the Prevent Typing dialog box, select Prevent type in special characters, and click OK. If confirmation dialogs appear, click Yes and then OK.
    Selecting Prevent type in special characters in the Prevent Typing dialog box
    Confirming the Prevent Typing settingsArrow pointing to the next confirmation dialogCompleting the Prevent Typing setup

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

Special characters being rejected in the selected cells

📝 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:

  1. Select the cells you want to clean. Then click Kutools > Text > Remove Characters.
    Opening the Remove Characters feature in Kutools for Excel
  2. In the Remove Characters dialog box, select Non-alphanumeric. Check the result in the Preview pane before applying the change.
    Selecting Non-alphanumeric in the Remove Characters dialog box
  3. Click OK or Apply. Kutools removes all non-alphanumeric characters from the selected strings.
    Result after removing non-alphanumeric characters

📝 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

Best Office Productivity Tools

🤖Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |  Round without Formula ...
Super Lookup: Multiple Criteria VLookup  |   Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |  Big Formula Bar   |  Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells   |  Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets:  12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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.

ExcelWordOutlookTabsPowerPoint
  • 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