Data validation is a feature available in Excel that helps you to control the information that is entered in the worksheets. This tutorial describes ways to use the data validation feature and examples to illustrate how to implement it.
Data validation restricts entries to a specific type in a cell. It allows you to do the following:
Data validation dialog box can be activated by choosing: Data -> Validation in Excel menu.
You can create a list of the entries you will accept for a cell in the worksheet. Such lists of items can be typed directly into the “Source” box in the data validation dialog box or it can be typed in a row or column on any worksheet in the workbook.
Follow these steps:
Refer to the screenshot for example. Note if you try to manually enter anything other than the list of entries that have been created in the Source box, a stop message will appear and your only options are Retry or Cancel.
Screenshot: Create a list by typing directly
You can also custom format your options such as displaying “1” and “0” as “Yes” and “No” respectively. Refer to screenshot and our tutorial titled Custom Formats in Excel to learn about custom formatting.
If the list of options is more than a couple of items, it will be easier to maintain if you type the list on a worksheet. For example in column E44:E46, type in the repayment options. The way to enter the reference in the data validation dialog box is as shown below Screenshot: Create a list in worksheet
Note: if the list of options is stored on a different sheet in the same workbook, you need to name the range first before using it as data validation source in another sheet. The screenshot below shows an example of where the list of options is named “Products” (The name box is located to the left of the formula bar). As shown, in the Source box in data validation dialogue box, we type in “= Products” or press F3 and paste in the range name.
Screenshot: Create a list in different worksheet
You can place limits on the data that can be entered in a cell. You can set or exclude a range of numbers, or set the minimum and maximum for certain cells.
Refer to the examples in the screenshot for various validation criteria examples, more examples can be found in the accompanied workbook. Input / Error message could be added to these types of restricted cells to alert user on kind of data allowed.
An Input Message can be displayed when the cell with data validation is selected:
Screenshot: Various validation criteria examples
Click on the Error Alert tab to activate then add a check mark to the box. The alert message can be typed in the designated box. There are three styles of Error Alert from the drop-down list:
Screenshot: Input Message and Error Alert