Applies ToExcel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2024 Excel 2024 for Mac Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2016 Office for business Microsoft Office

Use data validation to restrict the type of data or the values that users enter into a cell, like a dropdown list.

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

Select the cell(s) you want to create a rule for.

  1. Select Data >Data Validation.

    Data Validation

  2. On the Settings tab, under Allow, select an option:

    • Whole Number - to restrict the cell to accept only whole numbers.

    • Decimal - to restrict the cell to accept only decimal numbers.

    • List - to pick data from the drop-down list.

    • Date - to restrict the cell to accept only date.

    • Time - to restrict the cell to accept only time.

    • Text Length - to restrict the length of the text.

    • Custom – for custom formula.

  3. Under Data, select a condition.

  4. Set the other required values based on what you chose for Allow and Data.

  5. Select the Input Message tab and customize a message users will see when entering data.

  6. Select the Show input message when cell is selected checkbox to display the message when the user selects or hovers over the selected cell(s).

  7. Select the Error Alert tab to customize the error message and to choose a Style.

  8. Select OK.

    Now, if the user tries to enter a value that is not valid, an Error Alert appears with your customized message.

Tip: If you're a small business owner looking for more information on how to get Microsoft 365 set up, visit Small business help & learning.

Want more?

Create a drop-down list

Add or remove items from a drop-down list

More on data validation

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.