# Data validation and dropdowns

Data validation lets you control data input by enforcing specific rules or criteria. This helps improve data accuracy, consistency, and integrity when collaborating with multiple users.

![dropdown example in spreadsheet](https://cdn.sanity.io/images/2w8agf2t/production/cfded3811c5b5c18b01417257685482f520bac66-1914x847.png)

## How to add a data validation rule

1. Select your range and go to **Data validation** in the **Data** menu.  

   ![add data validation](https://cdn.sanity.io/images/2w8agf2t/production/0c554c6a73ae077c816af5749bd4a23376e31401-752x617.png)

2. Select your **Condition** and set the valid values or list options.  

   ![data validation rule between numbers](https://cdn.sanity.io/images/2w8agf2t/production/ec4ecf40422d7a9c2b8a315270263ec5f2f068fe-756x560.png)

3.   
Available conditions include:
    - Dropdown
    - Greater than
    - Greater than or equal to
    - Less than
    - Less than or equal to
    - Equal to
    - Not equal to
    - Between
    - Not Between
    - Text contains
    - Text does not contain
    - Text starts with
    - Text ends with
    - Text equals
    - Date equals
    - Date before
    - Date after
    - Date between
    - Custom formula
4. Optionally use **Advanced Options** to set custom error messages or warnings when invalid data is entered.

[Video](https://cdn.sanity.io/files/2w8agf2t/production/d01b0be37705af94e8f27723ae8ee281efff276f.mp4)

## Inserting a dropdown

Dropdowns are a type of data validation. In addition to selecting **Dropdown** as a condition when creating a data validation rule, you can also insert a dropdown by going to **Insert**, **Dropdown** in the header menu.

Here's how to insert a dropdown in your workbook:

1. Select the range where you'd like your dropdown and go to **Insert**, **Dropdown**.  

   ![insert dropdown in spreadsheet](https://cdn.sanity.io/images/2w8agf2t/production/e5e2ac58719fdf4fd0a8b962923dda923d5a4805-859x577.png)

2.   
This creates a data validation rule with condition set to dropdown. List options are automatically populated with any values present in your selected range.  

![dropdown list options](https://cdn.sanity.io/images/2w8agf2t/production/7cb6b5e0af21fd4a92b3e40878e7d8ee28054264-794x410.png)

You can add list options manually, or you can select a range to populate the dropdown. To use a range, change **Dropdown source** to **Range** and then click the **Select range** input box to open the range selector. Select your range for dropdown options and click **Confirm**.

![dropdown populated from a range](https://cdn.sanity.io/images/2w8agf2t/production/abd61f056e9164415401eb2487330409310c41f0-1914x920.png)

When you use a range as your dropdown source, the dropdown options will dynamically update as your source range updates.

## Editing and deleting data validation rules

View, edit, and delete any data validation rules on a sheet by going to **Data validation** in the **Data** header menu. Here you can add more rules and edit or delete existing rules.

![edit data validation rules](https://cdn.sanity.io/images/2w8agf2t/production/1de8c7cfbb37449abd1d2d6ed24f41c7d79025ba-1910x916.png)
