Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Data Validation: How to Set Up Rules and Drop-downs

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To put validation in Excel, select the cells you want to restrict, go to the Data tab, click Data Validation, and choose your criteria from the Allow dropdown menu. Data validation is a powerful tool used to control what users can enter into a cell, ensuring data integrity by preventing typos, incorrect date formats, or invalid numerical ranges. This is essential for spreadsheets used by multiple people, as it forces consistency and reduces the time spent cleaning data later.

What You'll Need

  • A computer with Microsoft Excel installed (Windows or macOS).
  • A dataset or a specific range of cells where you want to restrict input.
  • If you are creating a dropdown list from a range, a pre-written list of valid options located elsewhere in your workbook.

Step-by-Step

  1. Select the Target Cells: Click and drag to highlight the individual cells, a column, or a row that you want to apply the validation rules to. It is easier to apply validation to a large group at once than to do it cell by cell.
  2. Open the Data Validation Menu: Navigate to the Data tab on the top Ribbon. In the Data Tools group, click the Data Validation button. Note that depending on your screen resolution or Excel version, this may appear as a small icon with a checkmark and a stop sign.
  3. Configure the Settings Tab: In the Data Validation dialog box, ensure you are on the Settings tab. Under the Allow dropdown, choose the type of restriction you need:
    • Any Value: This removes all validation.
    • Whole Number: Restricts input to integers. You can set a range (e.g., between 1 and 100) or a limit (e.g., greater than 0).
    • Decimal: Similar to whole numbers, but allows floating-point numbers.
    • List: Creates a dropdown menu. You can either type the options directly into the Source box separated by commas (e.g., Yes,No,Maybe) or select a range of cells on your sheet that contains the list.
    • Date: Restricts input to a specific timeframe.
    • Time: Restricts input to a specific time range.
    • Text Length: Limits the number of characters entered (e.g., a ZIP code must be exactly 5 characters).
    • Custom: Allows you to enter a formula to define complex rules.
  4. Define the Constraints: Once you have selected the Allow type, use the Data dropdown (e.g., between, equal to, greater than) and enter the specific values in the Minimum and Maximum boxes.
  5. Set the Input Message (Optional): Click the Input Message tab. This allows you to create a small pop-up tooltip that appears when a user clicks the cell. Enter a title (e.g., "Entry Guide") and an input message (e.g., "Please enter a number between 1 and 10"). This helps users understand the rules before they make a mistake.
  6. Set the Error Alert (Optional): Click the Error Alert tab. This determines what happens when a user enters invalid data. You can choose from three styles:
    • Stop: Prevents the user from entering the data entirely. They must correct it or cancel.
    • Warning: Warns the user but allows them to click "Yes" to override the rule.
    • Information: Simply informs the user the data is invalid but allows it to stay.
    Enter a Title and an Error Message to explain why the input was rejected.
  7. Apply and Test: Click OK. Test the cell by entering a valid value, an invalid value, and (if you chose a list) clicking the dropdown arrow to ensure the options appear correctly.

Common Mistakes

One of the most frequent errors is creating a List validation by typing values into the Source box but forgetting to separate them with commas. If you type "Red Blue Green" without commas, Excel treats the entire phrase as a single option in the dropdown. Always use a comma without a space for the cleanest results.

Another common mistake is applying validation to a range and then inserting new rows. While Excel often carries validation down to new rows, it is not guaranteed if the row is inserted in a specific way. It is often better to convert your data range into an official Excel Table (Ctrl+T) before applying validation; this ensures that any new row added to the table automatically inherits the validation rules of the column above it.

Users also frequently forget to lock the cell references when using a Custom formula or a List source from another sheet. If your source list is in cells A1:A10, ensure you use absolute references (e.g., =$A$1:$A$10) so that the validation doesn't shift as it is applied to different cells in the range.

Tips

To create a Dynamic Dropdown List, instead of selecting a fixed range of cells, use a Named Range or a Table. If you turn your source list into a Table, you can name that table range. When you add new items to the bottom of that table, the dropdown menus throughout your workbook will update automatically without you having to go back into the Data Validation menu to expand the range.

If you need to apply the same validation rule to multiple non-adjacent cells, you can use the Format Painter. Set up the validation in one cell, click that cell, click the Format Painter (the paintbrush icon on the Home tab), and then click the other cells where you want the rule applied. Note that this copies all formatting, not just the validation.

For advanced users, the Custom option allows for powerful logic. For example, if you want to prevent duplicate entries in a column, you can use a COUNTIF formula. In the Custom box, enter =COUNTIF($A$1:$A$100, A1)=1. This tells Excel that the value being entered should only appear once in the specified range.

Troubleshooting

The dropdown arrow is missing: Ensure that the In-cell dropdown checkbox is checked in the Settings tab of the Data Validation dialog. If it is checked and still not appearing, check if the column width is too narrow or if the cell is formatted as a protected sheet where certain interactions are disabled.

Users are still entering invalid data: Remember that Data Validation only works during manual data entry. If a user copies a cell from elsewhere and pastes it into your validated cell, the pasted value will overwrite the validation rule and the invalid data will be accepted. To prevent this, you must protect the worksheet or use VBA scripts to disable pasting, as standard Excel validation cannot block "Paste" actions.

The List source is not found: If your source list is on a different worksheet, older versions of Excel required you to name the range first. While modern versions allow you to click over to another sheet, creating a Defined Name (via the Formulas tab > Name Manager) is the most stable way to reference lists across different sheets.

Validation is not applying to all cells: Check if you have merged cells in your range. Merged cells often cause unpredictable behavior with data validation. Unmerge the cells and use "Center Across Selection" in the Alignment settings instead.

Frequently Asked Questions

Can I make a dropdown list that changes based on another cell?

Yes, this is called a dependent dropdown. You achieve this by creating named ranges for your sub-categories and using the =INDIRECT() function in the Data Validation Source box, referencing the cell that contains the primary category.

How do I remove data validation from a group of cells?

Select the cells, go to Data > Data Validation, and click the Clear All button in the bottom-left corner of the dialog box, then click OK.

Can I use data validation to restrict entries to a specific email format?

You cannot do this with a simple dropdown, but you can use the Custom option with a complex formula that looks for the "@" symbol and a period using the SEARCH and ISNUMBER functions.

Does data validation work on Excel for the Web?

Yes, data validation is supported in the web version of Excel. You can create and edit rules, and dropdown lists will function similarly to the desktop application.

Can I limit a cell to only accept uppercase letters?

Yes, use the Custom option and enter the formula =EXACT(A1, UPPER(A1)) (assuming the cell is A1). This will force the user to enter text in all caps.