Related Tutorials
Data Validation
Data Validation allows you to specify what data is valid for a range of cells, helping to prevent errors on data entry. Data Validation also enables the creation of messages to assist the user when entering data and warn them of incorrect enries.
Creating a list of options
Using Data Validation you can create lists of items for the user to select from. This will prevent spelling mistakes, typos and usually speed up data entry.
- Select the range of cells you want to validate
- Click the Data tab on the Ribbon
- Click the Data Validation button from the Data Tools group
- The Data Validation dialogue box appears.
- In the Source field, either type the entries for the list seperated by commas, or select the range of cells holding the required entries
- Click Ok
Click the drop list arrow for the Allow field and select List
Ensure the In-cell dropdown checkbox is checked so that the list appears as a drop down menu
Data Validation is applied to the selected cells.
Now when the user clicks on a cell to enter data, the list of entries will appear.
If the user types an entry into a validated cell that does not match an entry in the list, the Data Validation error message appears
Excel messages are not known for their user friendly, easy to understand explanations, and this message is no different. However it is possible to create your own messages.
Data Validation messages
You can create your own input message (message that appears when a user selects a cell for data entry), and error alert (message that appears when a user enters invalid data.
- Select the range of cells with the Data Validation applied
- Click the Data tab on the Ribbon
- Click the Data Validation button from the Data Tools group
- Click the Input Message tab in the Data Validation dialogue box
- Click the Error Alert tab
- Click Ok
Enter a Title and Input Message
Select a Style, Title and enter an Error message
Ensure the Show error alert after invalid data is entered check box is checked so that data entries are validated. This can be unchecked if you want the functionality of the list, but would like users to be able to enter items that are not in the list
Now when a cell is selected or invalid data entered, the Data Validation messages will appear providing assistance to the user. The image below shows both messages displayed.
Validating dates and number entries
Validation can be applied to cells to help prevent the entry of incorrect number and date values.
- Select the range of cells you want to validate
- Click the Data tab on the Ribbon
- Click the Data Validation button from the Data Tools group
- Click the drop list arrow for the Allow field. Options are provided for validating whole numbers, decimals and dates
- Select an operator from the Data list
- Complete the necessary fields by entering the value or refering to a cell or range of cells that hold the validation criteria
- Click Ok
Select the required option from the list
The example below is validating entries to not accept a date in the past