Skip to main content
Validation turns a spreadsheet into a form. It restricts what a cell accepts and explains the rule when someone gets it wrong, which is worth doing on any file you send out to be filled in. All three rule types share the same range keys and error keys, and differ only in what they check.
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.
"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

Apply the rule well beyond the last populated row, to row 100 or 1000, so it still holds when someone adds entries.
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.
“Invalid entry” tells nobody anything. Name the permitted values or the bounds.