int
required
First row of the range.
int
required
First column.
int
required
Last row.
int
required
Last column.
str
Heading of the rejection dialog.
str
Body text. Say what is allowed, not just that the entry was wrong.
Dropdown lists
"list"
required
list[str]
required
The permitted values.
bool
Show the arrow. Leave it on unless you want the constraint hidden.
Numeric ranges
"whole_number" | "decimal"
required
whole_number rejects anything with a fractional part. decimal allows it.float
required
Lower bound, inclusive.
float
required
Upper bound, inclusive.
Text length
"text_length"
required
int
required
Fewest characters.
int
required
Most characters.
Practical notes
Validate past your data
Validate past your data
Apply the rule well beyond the last populated row, to row 100 or 1000, so it still holds when someone adds entries.
Validation isn't security
Validation isn't security
Rules apply to typing. Pasting into a validated cell can bypass them, and any recipient can delete the rule. Treat it as guidance and validate again when the file comes back.
Write useful messages
Write useful messages
“Invalid entry” tells nobody anything. Name the permitted values or the bounds.