Sub topic 1
What Data Validation Does and How to Open It
Prerequisites
This chapter assumes you can select cells and ranges, enter values, write basic formulas, and use references such as A2 and $A$2. You should also know how to refer to a cell on another sheet, such as Lists!A2:A10.
What data validation does
Data validation is a rule that controls which values a cell accepts. It checks an entry when someone types or selects a value. The rule can require a value from a list, a number within a range, a valid date, or text that meets a condition.
Validation does not change the cell's formatting. It also does not automatically repair an invalid value. Instead, it either rejects the value or allows it with a warning, depending on the rule's settings.
For example, suppose column A contains project statuses. A validation rule can limit each cell to these values:
- Not started
- In progress
- Done
A user can choose one of these values from a drop-down instead of typing it. This reduces spelling differences such as In progress, In-progress, and In Progress.
A validation rule has four important parts:
| Part | Purpose |
|---|---|
| Range | The cells where the rule applies |
| Criteria | The condition or list of allowed values |
| Invalid-data behavior | Whether invalid entries are rejected or warned about |
| Display settings | Whether a drop-down, help text, or chip is shown |
How validation fits into a sheet
Validation belongs to the input layer of a spreadsheet. It protects cells where people enter data, while formulas and charts usually consume that data.
Validation is local to the range that owns the rule. If you validate A2:A100, the rule does not automatically apply to column B or to new sheets. Plan the input range before creating the rule.
A rule can apply to one cell, a rectangular range, or several selected ranges. Applying it to a larger range is useful when new rows will receive the same kind of input. Applying it to a smaller range limits accidental changes elsewhere.
Open the data validation panel
To create or inspect a rule:
- Select the cell or range to validate.
- Open the Data menu.
- Select Data validation.
- In the side panel, select Add rule if the range has no rule.
- Check the Apply to range field.
- Choose a condition under Criteria.
- Configure how invalid data should be handled.
- Select Done.
The Apply to range field uses standard A1 notation. For example, Orders!C2:C500 applies a rule to column C on the Orders sheet. If you select a range before opening the panel, Sheets usually fills this field automatically.
If the selected cells already have a rule, the panel shows that rule. You can edit its criteria, change its invalid-data behavior, or remove it. If several selected cells have different rules, Sheets may show that the selection contains multiple rules. Inspect each rule before replacing it.
Choose the right scope
Use a narrow range when only a few cells need controlled input. Use a planned input range when a table will grow. For example, applying a status rule to C2:C1000 gives future rows room without affecting header cells or summary formulas.
Do not include a header in an input range unless the header satisfies the rule. A drop-down rule intended for project statuses should normally begin at row 2, not row 1.
Validation also depends on the cell's location. A rule copied to another sheet may still refer to the original range or formula references. Check the Apply to range field and any references after copying.
Check a rule before relying on it
Test both a valid and an invalid entry after creating a rule. Confirm that the rule affects the intended cells and that the behavior matches your workflow. A rule that rejects mistakes is useful for controlled forms. A warning may be better when users must record unusual but legitimate values.
Exercise
Exercise
You need to restrict B2:B200 to user-entered project statuses. What should you verify immediately after opening Data > Data validation?
Show answer
Verify that Apply to range shows B2:B200, then choose the required criteria and test both an allowed status and an unlisted value.