“Alphanumeric” refers to a set of characters that includes both alphabetical letters a to z (lowercase or uppercase) and numerical digits 0 to 9.
To validate alphanumeric data in Google Sheets, you can use formulas based on REGEXMATCH. The exact formula depends on whether you want:
- To allow only letters and numbers (not necessarily both), or
- To allow only entries that contain both letters and numbers.
Data Validation Rules to Validate Alphanumeric Data in Google Sheets
There are two main validation formulas to know:
=REGEXMATCH(A1, "^[A-Za-z0-9]+$")
This matches strings made up entirely of letters and numbers — no special characters, no spaces. It accepts either letters, numbers, or a mix of both.=AND(REGEXMATCH(A1, "^[A-Za-z0-9]+$"), REGEXMATCH(A1, "[A-Za-z]"), REGEXMATCH(A1, "[0-9]"))
This strictly requires both letters and numbers — no special characters allowed.

How to Apply Data Validation to Validate Alphanumeric Data in Google Sheets
- Select the column or range where you want to apply validation (e.g.,
A:A
). - Go to Data > Data validation.
- Under Criteria, select Custom formula is.
- Enter the formula that fits your rule (one of the two above).
- Check Reject input to prevent invalid entries.
- Click Done.

How to Adjust the Formula for Different Ranges
The formula references the first cell in your selected range.
- For a single column range like
B10:B50
, changeA1
toB10
. - For multi-column ranges like
A2:B10
, use the top-left cell (e.g.,A2
) in your formula.
Why Validate Alphanumeric Data in Google Sheets?
- Prevent entry of unwanted special characters.
- Ensure data consistency in IDs, codes, or usernames.
- Improve data quality for further processing.
FAQ: Validate Alphanumeric Data in Google Sheets
Q1: Can I allow spaces or special characters in my alphanumeric validation?
No. The formulas above allow only letters and numbers, excluding spaces and special characters.
Q2: How do I require both letters and numbers in a cell?
Use the formula with the AND
condition:=AND(REGEXMATCH(A1, "^[A-Za-z0-9]+$"), REGEXMATCH(A1, "[A-Za-z]"), REGEXMATCH(A1, "[0-9]"))
Q3: What happens if I paste invalid data?
If Reject input is enabled, invalid entries won’t be accepted when typed or pasted.
Q4: Can this validation work for multiple columns?
Yes, just adjust the cell reference in your formula to the top-left cell of your range.
Resources
- Restrict Entering Special Characters in Google Sheets (Data Validation)
- Reject a List of Items in Data Validation in Google Sheets
- Data Validation to Enter Values from a List as per the Order in the List in Google Sheets
- Allow Only N Digits in Data Validation in Google Sheets (Accept Leading Zeros)
- Limit Sales Qty Within the Stock Qty in Google Sheets (Data Validation)
- How to Sort Alphanumeric Values in Google Sheets