Validation
Validation
Introduction
Excel allows you to restrict data entry to cells to numbers, dates, or values from a list, then
let’s you validate the information being entered to ensure it matches the restrictions set.
5. On the Settings tab, in the Validation criteria area, use the pulldown for Allow to
select the option Whole number.
6. Further settings appear: enter a Minimum: of 0 and a Maximum: of 100
7. Click [OK].
Note** You do have to set up the minimum and maximum values. Excel will not let them
remain blank. However, you are not restricted to entering fixed values for there, you can also
enter an equals sign and then reference data cells.
8. Now type the word ‘Excel’ into cell B1.
\
9. Click on [Retry] and type ‘-75’.
10. Click on [Retry].
11. Type a whole number between 0 and 100.
Now when you click on cell C1 you will see the message displayed. The cell has to be active for
the message to show.
This will copy just the validation to the cells. Do NOT now press [Enter] or you will paste
again, but this time you’ll paste ALL the cell properties, including the data.
Note** If you use relative cell references in a validation, if you paste the validation to another
cell or cells, the reference will change relative to the new position. To prevent this, absolute
references (e.g. $B$1) must be used.
Non-Numeric Validations
You can use Excel for other validations besides whole numbers, such as numbers with decimal
points, dates or times and text (up to a specific number of characters). You can also restrict the
entry to a fixed list of values (numeric or non-numeric).
Note** You can also limit text to a range of characters by keeping the Data setting between
and then entering a minimum and maximum value.
67. Highlight cells L2 to L6 then click in the Name Box (above column A), type Women
and press [Enter].
68. Highlight cells K2 to K5, name the range Men and press [Enter].
69. Click in cell H1 and open [Data Validation].
70. On the Settings tab, use the pulldown on Allow: and select List.
71. Click in the Source box then highlight cells K1 to L1.
72. Click [OK].
Note** You have to set up this validation first in order for the second list setup to work,
otherwise you’ll get an error message.
The Indirect function uses the value shown in cell H1 (men or women) to define list that shows
in cell H2.
Obviously a user would have to select the value in cell H1 before being able to choose a value
in H2. When using this type of validation that must be kept in mind, but using Indirect can be
useful for things like setting up surveys. In the case of a survey, you would also want to hide
the named ranges (the lists of names in this case) by either hiding the columns or using white
for the font color.
For more tips about using lists and validation, watch the lecture video.
Customized Validations
All Excel validations test whether a criteria is TRUE or FALSE. If you want to set a validation
that does not already have an option in Data Validation, you can set up your own validation
test.
To set a budget with specific expense limits:
Note** Validation cannot be set on cell B14 since the validation check is performed on the
data entry and cell B14 contains calculated values. The validation must instead be set on the
cells that are used in the calculation.
Tip** You can create an absolute reference from a normal reference by pressing <F4> once
after you’ve typed the reference and before you’ve hit [Enter] or typed anything else.
90. Type an Error message: titled ‘Budget Error’, indicating that Expenditure must be
within the budget.
91. Click on [OK].
Now if the total calculated in cell B14 exceeds $20 the message will appear.
92. Enter amounts that total less than $20.00
If you want to test alternatives, you can use the OR function, while if you want to do a joint
test you can use the AND function.
Editing Validations
Suppose you want to change an existing validation. If you have multiple cells that contain the
same validation test, Excel lets you update it in all the cells at the same time.
Suppose 20% was too large, and we need to change the tip level to 15%:
97. Click in cell B12 (Note** You could do this with any of the validation cells).
98. Open [Data Validation].
99. On the Settings tab, change 20% in the Formula to 15%.
100. At the bottom of the window, make sure the check box for “Apply these
changes to all other cells with the same settings” is selected.
101. Edit the Error Message to reflect the new 15%.
102. Click on [OK].
103. From the Home tab, click on the [Find & Select] button on the far right.
104. Select Data Validation and any cell that contains validation will be displayed
with light blue shading.
105. Click on cell B12.
106. Click on [Find & Select] again but this time choose Go To Special…
107. Select Data validation and then select the Same.
108. Click [OK] to see only the cells with validation settings that match those for B12.
111. From the Data tab, use the pulldown on [Data Validation] to select Circle
Invalid Data. This will circle in red any cells with invalid values.
Click on the File tab, save the file to your computer, then answer the validation assessment
based on your file and/or comprehension of the lecture.