Check data entry for invalid entries

Excel 2016 2013 2010 2007 2003
You can greatly reduce data-entry problems in your workbooks by making Excel check entries before entering them in specific cells. To do so, you need to define restrictions and data-validation rules for those cells.

To make Excel check data entry for invalid entries, follow these steps:

   1.    Select the cell or range you want Excel to check.

   2.    On the Data tab, in the Data Tools group, click Data Validation:

Data Validation button in Excel 365   or   Data Validation button in Excel 365

   3.    In the Data Validation dialog box:

   3.1.    On the Settings tab, specify the validation criteria to use:

Data Validation in Excel 365

Select the appropriate type in the Allow drop-down list, and then set parameters accordingly:

  • Any Value accepts any input (Excel's default setting for cells). This setting effectively turns off validation, so you usually select it only when you need to remove validation from a cell or range. But you can also use this setting to display an informational message for a cell or range. Enter the title and message on the Input Message tab, as discussed in step 3.2.
  • Whole Number lets you specify a comparison operator and appropriate values. The user must not enter a decimal point.
    Number validation in Excel 365

    The validation criteria use these self-explanatory comparison operators: Between, Not Between, Equal To, Not Equal To, Greater Than, Less Than, Greater Than or Equal To, and Less Than or Equal To.

  • Decimal lets you specify a comparison operator and appropriate values. The user must include a decimal point and at least one decimal place (even if it's .0).
  • List lets you specify a list of valid entries for the cell. You can type in entries in the Source text box, separating them with commas, but the best form of the source is a range on a worksheet in the workbook. If you hide the worksheet, the users won't trip over it. Usually, you'll want to select the In-Cell Dropdown option to produce a drop-down list in the cell. Otherwise, users have to know the entries (or enter them from the help message):
    Data Validation in Excel 365

    See more about creating a dropdown list in a cell:

    Drop-down list in Excel 365
  • Date lets you specify a valid date range from the Data drop-down list choices.

    For example, you can specify that the entered data must be greater than January 1, 2020:

    Date validation in Excel 365
  • Time lets you specify a valid time range from the Data drop-down list choices.

    For example, you can specify that the entered data must be between 7 AM to 8 PM:

    Time validation in Excel 365
  • Text Length lets you specify a valid length using the Data drop-down list.

    For example, you can specify that the length of the entered data should be Equal To 1 (a single character).

  • Custom lets you specify a formula that returns a logical TRUE or a logical FALSE value.

The general checkboxes:

  • Ignore Blank (selected by default): If selected, blank entries are allowed.
  • Apply these changes to all other cells with the same setting (not selected by default): If selected, the changes apply to all other cells that contain the original data validation criteria.

    For example, if you need to change the Data Validation rule, you can open the Data Validation dialog box for just one cell and check the Apply these changes to all other cells with the same setting checkbox to see all the cells with the same rule. Make changes to the rule and apply it to all cells with the same original rule:

Apply these changes to all other cells with the same setting in Excel 365

See more about how to check the existing data using the Data Validation feature.

   3.2.    On the Input Message tab, choose whether to have Excel display an input message when the cell is selected. If you leave the Show input message when cell is selected checkbox selected (as it is by default), enter the title and input message in the text boxes:

Input Message validation in Excel 365

When a user selects a restricted cell, Excel displays the information message (unless you choose not to display one), E.g.:

Input Message example Excel 365

   3.3.    On the Error Alert tab, choose whether to have Excel display an error alert after the user enters invalid data in the cell. If you leave the Show error alert after invalid data is entered checkbox selected (as it is by default), choose the style (Stop, Warning, or Information) in the Style drop-down list, and enter the title and error message in the text boxes.

Error Alert validation in Excel 365
  • Stop alerts prevent the user from continuing until they enter a valid value for the cell:
    Stop validation message example Excel 365
  • Warning alerts and Information alerts display the message but allow the user to continue after entering an invalid value in the cell:
    Warning validation message example Excel 365
    Information validation message example Excel 365

   4.    Click the OK button to close the Data Validation dialog box and apply the validation to the cell or range.

See also this tip in French: Comment vérifier l'entrée de données pour les valeurs non valides.

Please, disable AdBlock and reload the page to continue

Today, 30% of our visitors use Ad-Block to block ads.We understand your pain with ads, but without ads, we won't be able to provide you with free content soon. If you need our content for work or study, please support our efforts and disable AdBlock for our site. As you will see, we have a lot of helpful information to share.