Apply data validation to cells

macOS:

If you’re creating a sheet that requires users to enter data, you might want to restrict entry to a certain range of dates or numbers, or make sure that only positive whole numbers are entered. Excel can restrict data entry to certain cells by using data validation, prompt users to enter valid data when a cell is selected, and display an error message when a user enters invalid data.

Newer versions

Restrict data entry

  1. Select the cells where you want to restrict data entry.
  1. On the Data tab, click Data Validation > Data Validation.

Note: If the validation command is unavailable, the sheet might be protected or the workbook might be shared. You cannot change data validation settings if your workbook is shared or your sheet is protected. For more information about workbook protection, see Protect a workbook.

  1. In the Allow box, select the type of data you want to allow, and fill in the limiting criteria and values.

Note: The boxes where you enter limiting values will be labeled based on the data and limiting criteria that you have chosen. For example, if you choose Date as your data type, you will be able to enter limiting values in minimum and maximum value boxes labeled Start Date and End Date.

Prompt users for valid entries

  1. When users click in a cell that has data entry requirements, you can display a message that explains what data is valid.
  1. Select the cells where you want to prompt users for valid data entries.
  1. On the Data tab, click Data Validation > Data Validation.

Note: If the validation command is unavailable, the sheet might be protected or the workbook might be shared. You cannot change data validation settings if your workbook is shared or your sheet is protected. For more information about workbook protection, see Protect a workbook.

  1. On the Input Message tab, select the Show input message when cell is selected check box.
  1. In the Title box, type a title for your message.
  1. In the Input message box, type the message that you want to display.

Display an error message when invalid data is entered

  1. If you have data restrictions in place and a user enters invalid data into a cell, you can display a message that explains the error.
  1. Select the cells where you want to display your error message.
  1. On the Data tab, click Data Validation > Data Validation.

Note: If the validation command is unavailable, the sheet might be protected or the workbook might be shared. You cannot change data validation settings if your workbook is shared or your sheet is protected. For more information about workbook protection, see Protect a workbook.

  1. On the Error Alert tab, in the Title box, type a title for your message.
  1. In the Error message box, type the message that you want to display if invalid data is entered.
ToOn the Style pop-up menu, select
Require users to fix the error before proceeding.Stop
Warn users that data is invalid, and require them to select Yes or No to indicate if they want to continue.Warning
Warn users that data is invalid, but allow them to proceed after dismissing the warning message.Important

Need more help?

You can always ask an expert in the Excel Tech Community, get support in the Answers community, or suggest a new feature or improvement on Excel User Voice.

See Also

More on data validation

Add or remove items from a drop-down list

Remove a drop-down list

Leave a Reply

%d bloggers like this: