Skip to content

Google Sheets

Google Sheets data validation and protection

Data validation shapes what users enter; protection limits what they can change. Together they prevent most spreadsheet accidents, but neither is security.

Talha Ansari··6 min read

Key takeaways

  • Validation controls new entries; protection controls edits to formulas and structure.
  • Use range-based dropdown lists so categories change in one place.
  • Custom formulas are evaluated relative to the top-left cell of the range.
  • Protection prevents accidents, not determined users with edit access.
On this page

Two controls, different jobs

Data validation checks an entry when it is made. It can reject a value, warn about it, or offer a dropdown. Protection limits who can change cells, ranges, or sheets. Validation is about the content of an input; protection is about the surface around it.

Neither is a security control. A user with edit access can paste over a validated cell, and an editor can remove protection from a range. Use these features to make the correct action easy and the accidental action hard, not to conceal data.

Start by defining the input surface: the cells a user is expected to complete, the cells that are calculated, and the cells that are reference data. Every control should map to one of those categories.

Choose the validation rule

Dropdowns are the most useful rule for categories, owners, and status. Point the rule at a range on a reference sheet rather than typing a list of items. The range can grow without editing every rule, and a named range keeps the reference stable when columns move.

Numbers need a type and a bound: whole numbers for quantities, decimals for rates and amounts, and a sensible minimum. Dates need a real date rule, not a text rule, or sorting and filtering will fail later. Add help text with the expected unit or format.

Custom formulas cover the rules the menu does not. The formula is written for the top-left cell of the selected range and uses relative references to apply to each row. =COUNTIF($B$2:$B, B2) = 1 rejects a duplicate key. =AND(ISNUMBER(C2), C2 > 0) rejects blanks, text, zero, and negatives in one test.

Validation rules and their limits
RuleExample useWatch out for
Dropdown from rangeCategory, owner, or statusA deleted source range breaks the rule
Number boundQuantity or rateUnits differ between rows
DateTransaction or period dateText dates look right but fail sorting
Custom formulaUnique key or conditional requirementRelative references start from the top-left cell

Reject or warn

Reject input stops an invalid entry. Use it for keys, dates, and categories that feed formulas, where a wrong value corrupts a total. Warning allows the entry but marks it. Use warnings for soft rules where an exception is legitimate, such as a discount above the standard limit.

Write a message that tells the user what to do. Rejected input is a dead end; a message that names the allowed format and gives an example turns it into a correction. The message is part of the control, not decoration.

Adding validation does not clean existing data. Audit the current values first, fix or flag them, and then apply the rule. A sheet with a validation rule and a column of legacy exceptions is worse than no rule, because it looks controlled.

Protect structure without blocking work

Protect calculation and output sheets, and leave the input cells editable. In Sheets, sheet protection can exclude specific ranges, or you can protect selected ranges and leave the rest open. Both work; the exclusion approach is easier to explain to users.

Choose between a warning and a restriction. A warning lets trusted editors proceed and suits a small team. A restriction limits editing to named people and suits a published report. Neither stops a viewer from copying the file, and an owner can always change the protection.

Scripts need thought. An installable trigger runs as its creator, so a protected range may block a write if the creator lacks access. Test the script against the protected sheet, and give it a narrow admin range rather than unprotecting the whole sheet.

Manage lists and exceptions

Keep reference lists on one sheet, give them a name, and point every dropdown at that name. When a new category is approved, add it once. Scattered lists of items are how two dropdowns end up with different spellings of the same category.

For a period close, protect the closed sheet and add a small adjustment area for authorised changes. Log each adjustment with a reason and an owner. The alternative, unprotecting the sheet at month end, removes the control exactly when it matters.

Review protection after staff changes. A departed editor may still have access through a group, and a new analyst may be unable to update a list they own. Access reviews are part of the control, not an annual chore.

  • Input cells unlocked, formulas and outputs protected.
  • Dropdowns point at one named reference range.
  • Keys validated for uniqueness with COUNTIF.
  • Dates validated as dates, amounts with a unit and a minimum.
  • Warning only where exceptions are legitimate.
  • A named owner and a quarterly access review.

Test the controls

Test with the behaviour you are trying to stop: paste a block into the input area, type a duplicate key, enter a date as text, and run the script that writes to a protected sheet. A control that has never been tested is a hope.

Check the user path as well. A validation message should appear where the user is looking, a protected cell should still allow copying, and a legitimate exception should be possible without removing protection.

Frequently asked questions

Can users paste invalid data into a validated cell?+

Pasting and scripts can bypass validation in some cases. Validation is a guardrail; reconcile the data if the source is untrusted.

Does protection stop someone from viewing data?+

No. Protection limits editing. Anyone with view access can read the values, and anyone with edit access may be able to remove the protection.

How do I prevent duplicate entries?+

Use a custom formula rule such as COUNTIF($B$2:$B, B2) = 1 on the key column, and keep the key visible so users can see the conflict.

Need help applying this?

Improve your excel & google sheets.

Review the service scope or tell us what you are trying to improve. We will reply with a clear next step.

Free KPI definition template

Related reading

Google Sheets·5 min read

Google Sheets dashboards with pivot tables

A pivot dashboard is a data source, a pivot layer, and a presentation sheet. Get the source clean, keep the pivot stable, and make refresh an explicit step.

Read