Excel Data Validation: Dropdowns, Custom Rules, and Error Alerts
Data validation prevents bad input from entering your spreadsheet in the first place — wrong formats, invalid ranges, duplicates, or entries that break downstream formulas. It is the first line of defence for any shared workbook.
How to Open Data Validation
Select the cell or range → Data tab → Data Validation (the icon shows a table with a tick). The dialog has three tabs: Settings (the rule), Input Message (tooltip when cell is selected), and Error Alert (message when invalid entry is attempted).
7 Validation Types
Allow: Whole Number, Data: between, Minimum: 1, Maximum: 100Good for quantities, scores, counts, or any field where decimals are invalid.
Allow: Decimal, Data: greater than or equal to, Minimum: 0Use for percentages, prices, measurements — anything that can have decimal places.
Allow: List, Source: North,South,East,West (or =$A$1:$A$4)Most commonly used. Type values comma-separated or reference a range. Use a named range as the source for easy maintenance.
Allow: Date, Data: between, Start Date: =TODAY()-365, End Date: =TODAY()Use TODAY() as a dynamic bound so the allowed range updates automatically each day.
Allow: Time, Data: between, Start Time: 09:00, End Time: 17:30Useful for timesheet inputs or scheduling tools.
Allow: Text Length, Data: less than or equal to, Maximum: 50Good for fields that feed into databases with character limits, or reference codes with fixed formats.
Allow: Custom, Formula: =AND(LEN(A2)=10, ISNUMBER(A2*1))The most powerful option. The formula must return TRUE for valid entries. The formula references the top-left cell of the selection — it adjusts relatively for other cells.
Error Alert Types: Stop, Warning, Information
On the Error Alert tab, the Style dropdown controls what happens when a user types an invalid entry:
- Stop — rejects the entry. The user cannot confirm until they type a valid value or press Escape. Use when invalid data would cause downstream formula errors or data integrity problems.
- Warning — shows an alert but lets the user click Yes to keep the invalid entry anyway. Use when the rule is a guideline rather than a hard constraint.
- Information — shows a message but does not block the entry. Useful for noting formatting expectations without enforcing them.
Always write a clear error message that tells the user what is expected, not just "Invalid entry." For example: "Please enter a date between today and 90 days from now."
Dependent Dropdown Lists
A dependent dropdown changes its options based on another cell's value. For example, selecting "Europe" in cell A2 shows only European countries in the B2 dropdown.
The approach: create named ranges for each group of options (name each list after the parent value — "Europe", "Asia", "Americas"). Then set the dependent cell's Data Validation Source to =INDIRECT(A2). INDIRECT converts the text in A2 into a range reference that matches the named range with that name.
Important: the parent cell must contain an exact match to the named range name, including capitalisation.
6 Custom Formula Rules
Custom validation uses any formula that returns TRUE (accept) or FALSE (reject). The formula references the top-left cell of your selection and adjusts relatively for the rest.
No duplicate values in a column
=COUNTIF($A$2:$A$1000, A2)=1Rejects entry if the value already exists anywhere in A2:A1000. The first argument uses absolute references; the second (A2) adjusts relatively as you copy down.
Must start with a specific prefix
=LEFT(A2, 3)="SKU"Only accepts entries where the first 3 characters are "SKU". Useful for product codes, reference numbers, or any field with a required prefix.
Must be a valid email address (basic check)
=AND(ISNUMBER(FIND("@",A2)), ISNUMBER(FIND(".",A2,FIND("@",A2))))Checks that the entry contains @ and a . after the @. Not a complete email validator, but catches obvious typos.
Date must be a weekday (no weekends)
=WEEKDAY(A2, 2)<=5WEEKDAY with type 2 returns 1–7 where Mon=1, Sun=7. Checking <=5 excludes Saturday (6) and Sunday (7).
Entry required (cell cannot be left blank)
=A2<>""Rejects empty entries. Combined with a Stop error alert, forces the user to fill in the field before moving on.
Percentage must sum to 100%
=SUM($B$2:$B$10)=1Validates each allocation cell in a group that must total 100%. All cells in B2:B10 share this rule — any change that pushes the sum over or under 1 (100%) is rejected.
Common Issues with Data Validation
- Pasted data ignores validation — data pasted from another source bypasses validation rules. Use Paste Special → Values only, which still bypasses validation. The only full protection is worksheet protection combined with validation.
- Existing invalid data is not flagged — validation only checks new entries. To find existing invalid cells: Data → Data Validation → Circle Invalid Data. Red circles appear on all cells that fail the rule.
- INDIRECT-based dependent dropdowns show #REF! — the parent cell value must exactly match the named range name. Check for spaces, capitalisation differences, or characters that are invalid in named ranges.
- Dropdown list is not showing all items — if the source range has blank cells or the list is defined with extra blank rows, the dropdown may show empty entries. Define the source range to exactly match the data, or use a dynamic named range / Excel Table as the source.
Frequently Asked Questions
How do I create a dropdown list in Excel?
Select the cell → Data → Data Validation → Allow: List → type comma-separated values or select a range in Source → OK. A dropdown arrow appears when the cell is selected.
How do I stop users from entering invalid data in Excel?
Data → Data Validation → Error Alert tab → Style: Stop → write a helpful error message. Excel will reject any entry that fails the validation rule.
Can I apply data validation to an entire column in Excel?
Yes — click the column header letter to select the whole column, then apply Data Validation. For better performance, select just the data range (B2:B1000) rather than the entire column.
Related Guides
Dropdown List Guide
More on dropdown lists — including dynamic lists and fixing common dropdown problems.
Read →
Named Ranges Guide
Use named ranges as dropdown sources — easier to maintain than fixed cell references.
Read →
Lock Cells in Excel
Combine data validation with cell protection to fully control what users can edit.
Read →
Excel Best Practices
Data validation is one of 10 practices that keep spreadsheets accurate and maintainable.
Read →