Week2 CriteriaBasedFunctions Data Validation
Week2 CriteriaBasedFunctions Data Validation
COUNTIFS Function
• The COUNT function calculates how many (number values) values are in a cell range
• COUNTA counts how many non-numerical values are in a cell range
• COUNTBLANK will count how many cells do not have a value in them
• COUNTIF/COUNTIFS will count how many values are in a range where a specific criterion is
applied
• COUNTIFS will allow choose more than one range. It is recommended that you use this
version of the function
• It is important to not confuse COUNT functions with SUM functions
• COUNT functions provide us with a result that shows how many cells in the range we have
selected have values in them
• SUM functions will add those values together (if they are numerical values)
In this example, we are going to provide a dynamic report for employee sales data. Our objective is
to generate a record that will tell us
4. Select COUNTIFS from the options and press the tab key to open the function
5. Note that Excel will describe the arguments required for this function (Figure 5)
SUMIFS Function
• To calculate the total sum of sales for a specific employee we need to use the SUMIFS
function
• SUMIFS Function has one additional argument
• Along with criteria range and criteria, the SUMIFS function also requires the SUM range
• In our Employee Sales Record, we will now insert a SUMIFS function to calculate the total
sales for a specific employee
7. To test both functions enter a different employee ID into the EMPID cell
8. Note how the functions update automatically
• However, we can make this record more automated
• We do not have to type in an employee ID each time
• Instead we can use a feature in Excel known as data validation
• Data validation allows us to implement a scope or boundary to a cell or range of cells
• In our Employee Sales Record, we will now insert data validation in the form of a drop-
down list for Employee ID
DATA VALIDATION
To insert data validation for our example, do the following
9. In the settings tab, we want to define the scope/set the criteria for or DV
10. Click on the ALLOW drop down
11. Note all the various validation options (Figure 17)
14. In the drop-down list settings (figure 18) make sure “ignore blank” and “in-cell dropdown”
are ticked
15. Next, select the source dialogue box
16. Here, we need to tell the system what data to generate the list from
17. We can manually input these, however, this is not a good idea (reference)
18. In our workbook we have an “Employee List” worksheet
19. Once you have selected the source box, click on the “Employee List” worksheet
20. In the “Employee List” sheet select/highlight all the employee IDs in the table ( Figure 19)
21. Note: When selected, the source box in the data validation window will describe the range
and also the worksheet the data is coming from
22. Because the Employee IDs are coming from a different worksheet excel will need to
reference the worksheet along with the range of cell references
23. See Figure 20
24. Press OK
25. We now have a drop-down list of employee IDs in our employee sales record (Cell F6)