Topic 09
Data Validation
Data Validation lets you control what users can enter into a cell — before they type it. It supports seven input types, guides users with messages, and enforces rules with customisable error alerts. It also has two important limitations that every Excel user should know.
The Seven Validation Types
All types are found in the Settings tab of the Data Validation dialog under the Allow dropdown. The most powerful — and most flexible — is Custom.
| Type | What it restricts | Typical use |
|---|---|---|
| Whole Number | Integers only — within a range, greater than, less than, etc. | Quantity, age, headcount |
| Decimal | Any number including decimals — with the same comparison options. | Price, weight, percentage |
| List | Only values from a defined set — shown as a dropdown arrow in the cell. | Status, department, category |
| Date | Date values within a range or relative to today. | Hire date, deadline, event date |
| Time | Time values within a range — useful for shift scheduling. | Start time, end time |
| Text Length | Restricts the number of characters entered. | Codes, phone numbers, short labels |
| Custom ✦ | Any formula that returns TRUE or FALSE. Entry is accepted when the formula returns TRUE. | Workdays only, unique values, conditional rules — see advanced examples below |
=$A$1:$A$5 — dynamic, add items to the range and the dropdown updates.
Typed directly: Small,Medium,Large — static, comma-separated, no spaces. Use the range approach for anything that might change.
Input Message — Guide Before They Type
The Input Message tab lets you define a tooltip that appears whenever the validated cell is selected. It appears before the user starts typing — before any error can occur.
- The tooltip appears automatically when the cell is clicked — no action needed from the user.
- Title is optional but helps distinguish multiple validated cells on the same sheet.
- Uncheck "Show input message when cell is selected" to disable it without deleting the text.
Error Alert — Three Styles
The Error Alert tab controls what happens when invalid data is entered. The three styles differ in how strictly they enforce the rule.
Two Important Limitations
Data Validation is powerful but not airtight. Two gaps are worth knowing before you rely on it for critical data.
Advanced Custom Rules
Both examples use the Custom type — a formula that returns TRUE to accept the entry, or FALSE to reject it.
WEEKDAY function converts a date into a day-of-week number — the mode 2 makes Monday = 1 and Sunday = 7.
WEEKDAY default mode — the number map
Green 1–5 = Sun–Thu, workdays (accepted) · Red 6–7 = Fri–Sat, weekend (rejected)
The formula
How to apply it
=WEEKDAY(A1)<=5 (use the first cell of your selection — it adjusts for the rest).<=5 condition lines up perfectly with the default numbering — no mode argument needed.COUNTIF to count how many times the entered value already exists in the range. If the count is more than 1 (meaning the value exists elsewhere too), the entry is rejected.
The formula
1 (only this cell has it). A duplicate returns 2 or more. That's why the condition is = 1, not = 0.
How to apply it
A1:A100.=COUNTIF($A$1:$A$100,A1)=1 — the range is absolute (locked with $), the cell reference A1 is relative so it adjusts for each row.$A$1:$A$100 is locked so the range never shifts as the formula is applied to each row. A1 is relative so each row checks itself. This is the same mixed/absolute reference logic from Topic 01 — now being applied inside a validation formula.