Google Sheets Course: Data Validation

As its name suggests, data validation allows to ensure the validity of entered data and to display an error message or reject the entry if the data is not valid.

This feature allows to validate data by limiting the possible input choices or by testing the entered value against a defined criteria.

The example file: lesson-10d.xlsx


Validation based on a range

Select the range that should contain valid data and click on "Data Validation" in the Data menu:

google sheets data validation png

Add a rule and select "Dropdown (from a range)":

google sheets validation dropdown menu range png data

Now enter the range of cells that contains the list of valid data:

google sheets validation data range png

If you wish, you can assign colors to the different choices:

google sheets validation data dropdown menu colors png

In the advanced options, you can (if necessary) define a custom validation message, choose whether to display a warning or whether to refuse input in case of invalid value (in this case, a value that is not part of the proposed choices) and modify the display style of the dropdown list:

google sheets validation data dropdown list png

Validation based on a list of choices

To add a drop-down menu whose choices are static, you can select "Dropdown":

google sheets validation data list png

This criteria then allows to directly list the possible choices:

google sheets validation data dropdown list cell png

Validation based on a number

To apply a criteria related to a numerical value, select one of the following criteria:

google sheets validation data number

In this case, only data between 0 and 1000 will be accepted:

google sheets validation data number message png

Validation based on a date

When the criteria is related to a date, select one of the following criteria:

google sheets validation data date

Validation based on a text

When the criteria is related to a text, select one of the following criteria:

google sheets validation data text

Validation based on a formula

For more personalized data validations, choose formula validation.

In this example, the formula will check if the entered value is unique and will display a warning in case of duplicates:

=COUNTIF($B$2:$B$16,B2)=1

google sheets validation data formula png

The "C" is entered twice, the warning is then displayed:

google sheets validation data duplicates