Understanding Data Validation in Excel: Drop-Down Menus and More
Data validation in Excel controls what people can type into a cell. It is one of the simplest ways to keep a spreadsheet accurate, because it stops bad data at the moment of entry instead of leaving you to find and fix it later.
The most familiar use is the drop-down menu, which lets people pick from a set list instead of typing, so "Electronics" never becomes "electronic" or "Elec." But data validation can also limit entries to numbers in a range, dates in a window, text of a certain length, or anything a formula can test.
This guide explains how data validation works, how to build static and dynamic drop-down menus, how to use the other rule types and custom formulas, and how to write helpful input messages and error alerts. A free rule builder at the end lets you test any rule before you apply it.
What Is Data Validation?
Data validation lets you set rules for a cell or range so that only entries meeting your criteria are accepted. If someone types something that breaks the rule, Excel can block it, warn them, or simply inform them, depending on how you set it up.
That makes it invaluable for any sheet that other people fill in, such as budget templates, timesheets, order forms, and inventory lists. Clean inputs mean formulas, PivotTables, and reports built on the data work correctly the first time.
You will find it on the Data tab, in the Data Tools group, under Data Validation. The dialog has three tabs: Settings, where you define the rule, Input Message, where you add a tip that appears when the cell is selected, and Error Alert, where you control what happens when someone enters invalid data. Microsoft's guide to applying data validation to cells covers every option.
The Types of Data Validation
The Allow box on the Settings tab offers eight options. The table summarizes each.
| Allow setting | What it restricts | Example |
|---|---|---|
| Any value | Nothing, the default. Use it to show an input message only. | A notes column |
| Whole number | Integers within limits you set | Quantity between 1 and 100 |
| Decimal | Numbers, including decimals, within limits | A discount from 0 to 0.25 |
| List | Only the values in a list, shown as a drop-down | Department or product category |
| Date | Dates within a range | A due date no earlier than today |
| Time | Times within a range | Shift start between 6:00 AM and 10:00 AM |
| Text length | The number of characters | Codes of 10 characters or fewer |
| Custom | Anything a formula returning TRUE or FALSE can test | No duplicates, multiples of 5 |
How to Create a Drop-Down Menu
Drop-down menus are the most popular use of data validation. They speed up entry, eliminate typos, and make every entry consistent so it can be summarized reliably. You can also watch this one-minute drop-down video.
Step 1: Prepare Your List of Options
Type the options into a column, ideally on a separate sheet named something like "Lists" so they are easy to maintain. For a product category drop-down, you might enter Electronics, Clothing, Furniture, Books, and Toys in cells F1 through F5.
Step 2: Select the Cells for the Drop-Down
Select the cell or range where people should choose a category, for example A2 through A100. Applying the rule to the whole column range at once saves repeating the steps.
Step 3: Apply Data Validation
Go to the Data tab and click Data Validation. On the Settings tab, set Allow to List. In the Source box, select your list or type its reference, such as =$F$1:$F$5. Make sure In-cell dropdown is checked, then click OK.
Each selected cell now shows a drop-down arrow listing the five categories. For a very short list, you can also type the options directly into the Source box separated by commas, such as High,Medium,Low, with no range needed.
Making Drop-Down Lists Dynamic
A fixed range like F1:F5 has one weakness: if you add a sixth category in F6, the drop-down will not include it. There are two good fixes.
Use an Excel Table
Select your list and press Ctrl + T to turn it into a table. Then give it a name, or define a name that refers to the table column, and use that name as the source. Because tables grow automatically, new items appear in the drop-down as soon as you type them. Our guide to making tables in Excel explains how tables work.
Use a Named Range
Select the list, go to the Formulas tab, click Define Name, and enter a name such as ProductCategories. In the Data Validation Source box, type =ProductCategories. Named ranges make the rule easier to read, and if you base the name on a table column or a dynamic formula, the list updates itself.
In current versions of Excel you can also point to a spilled dynamic array. If D2 contains =SORT(UNIQUE(Orders[Category])), a Source of =$D$2# gives you a sorted, duplicate-free drop-down built straight from your data.
Other Data Validation Options
Restricting Numbers
To allow only whole numbers between 1 and 100 in a quantity column, set Allow to Whole number, Data to between, Minimum to 1, and Maximum to 100. For values that can include decimals, such as a rate between 0.5 and 10.5, choose Decimal instead. Other comparison options include greater than, less than, equal to, and not between.
Restricting Dates and Times
Set Allow to Date and Data to between, then enter a start and end date. The limits do not have to be fixed dates. You can use formulas or cell references, so a start date of =TODAY() blocks any date in the past, and an end date of =TODAY()+90 blocks anything more than 90 days ahead. Time works the same way for shift start and end times.
Restricting Text Length
Set Allow to Text length and Data to less than or equal to, then enter the limit. This is useful for codes, IDs, and fields that feed other systems with character limits, such as a 10-character order code.
Custom Formula Rules
Custom rules accept any formula that returns TRUE or FALSE, which opens up almost unlimited possibilities. As with conditional formatting, write the formula for the first cell in your selection, and Excel adjusts it for the others.
To require a multiple of 5 in column G, use =MOD(G2,5)=0. To prevent duplicate invoice numbers in A2 through A500, use =COUNTIF($A$2:$A$500,A2)=1. To require an entry that starts with "INV-", use =LEFT(A2,4)="INV-". And to allow a value only when another cell is filled in, such as an approval date that requires an approver name in C2, use =C2<>"".
Input Messages and Error Alerts
Good validation explains itself. On the Input Message tab, add a short title and message that appear whenever someone selects the cell, such as "Enter the quantity ordered, 1 to 100." It prevents most errors before they happen.
On the Error Alert tab, choose what happens when someone enters invalid data. There are three styles. Stop blocks the entry completely. Warning explains the problem and asks whether to continue. Information simply notes the issue and accepts the value. Always write a custom message that says what is allowed, such as "Please choose a category from the list," rather than relying on Excel's generic error.
Free Data Validation Rule Builder and Tester
Use the builder below to design a rule and test it before you apply it. Choose a rule type, set the limits, and type a test value. The builder tells you whether Excel would accept it and lists the exact settings to choose in each tab of the dialog, including the custom formula and a ready-to-use error message.
Click Copy Practice Sheet to Excel for a small sheet with helper formulas that check list membership, number ranges, text length, multiples, and duplicates. It is a safe place to practice before adding validation to a live workbook.
Data Validation Rule Builder and Tester
Pick a rule type, set its limits, and type a test value to see whether Excel would accept it. The builder shows the exact settings to choose in the Data Validation dialog, including the custom formula where one is needed, and writes a matching error message. Copy a practice sheet to Excel with helper formulas that check each rule. Nothing you enter is saved or sent anywhere.
| Data Validation dialog | Setting |
|---|
Finding and Clearing Data Validation
To see every cell with validation on a sheet, go to Home, Find and Select, then Data Validation. To check existing entries against the rules, which matters because validation does not recheck data that was already there or pasted in, use Data, Data Validation, then Circle Invalid Data. Excel draws a red circle around every entry that breaks a rule.
To remove validation, select the cells, open Data Validation, click Clear All, and then click OK.
Limitations to Know
Data validation is powerful, but it is not foolproof. Pasting values over a validated cell can remove or bypass the rule, so protect important sheets or use Circle Invalid Data regularly. Validation only checks new entries, not data that existed before the rule was applied. And drop-down lists show every item in the source, so very long lists are better handled with a searchable, dynamic source.
From Spreadsheets to Systems
Data validation keeps spreadsheet inputs clean. When those inputs are time entries, PTO requests, or project updates from a whole team, Updoot is business management software that builds the rules in, with structured forms, approvals, and consistent categories for $5 per user per month. You can start a free trial anytime.
Final Thoughts
Data validation is one of Excel's most practical features for keeping data accurate and consistent. Start with drop-down menus, make them dynamic with tables or named ranges, then add number, date, text length, and custom formula rules where they help. Pair every rule with a clear input message and error alert, and your spreadsheets will collect clean data from anyone who uses them.
Sources
Dialog options and behavior follow Microsoft's guide, Apply data validation to cells.
Opens in Google Drive. View and download for free.
Related Reading
Frequently Asked Questions About Excel Data Validation
What is data validation in Excel?
Data validation sets rules for what can be entered in a cell, such as a list of choices, numbers in a range, dates in a window, or anything a custom formula can test. Invalid entries can be blocked or flagged.
How do I create a drop-down list in Excel?
Select the cells, go to Data, then Data Validation, set Allow to List, enter or select the source range, make sure In-cell dropdown is checked, and click OK.
How do I make a drop-down list update automatically?
Base the list on an Excel table or a named range that refers to a table column. When you add items to the table, they appear in the drop-down automatically.
How do I prevent duplicate entries in Excel?
Select the range, choose Data Validation, set Allow to Custom, and use a formula such as =COUNTIF($A$2:$A$500,A2)=1.
What is the difference between Stop, Warning, and Information alerts?
Stop blocks an invalid entry. Warning explains the problem and lets the user choose whether to continue. Information notes the issue but accepts the entry.
Why is invalid data still in my validated cells?
Validation only checks new typed entries. Data that existed before the rule, or that was pasted in, is not rechecked. Use Data Validation, then Circle Invalid Data, to find it.
How do I remove data validation?
Select the cells, open Data Validation, click Clear All, and then click OK.