Explanation
In this example, the goal create a formula that will return TRUE when a volunteer has successfully logged the required number of hours in each of the three categories. Two requirements must be satisfied:
- A volunteer should have at least 5 hours in each of the three categories.
- A volunteer needs to have at least 15 hours in total.
Both requirements are evaluated inside a single AND function in a formula like this:
=AND(COUNTIF(C6:E6,">=5")=3,SUM(C6:E6)>=15)
The first requirement is at least 5 volunteer hours in each of the 3 categories: A, B, and C. This requirement is tested with a logical statement based on the COUNTIF function:
COUNTIF(C6:E6,">=5")=3
In the range C6:E6, we count numbers greater than or equal to 5. We need a result of 3 for this requirement to be satisfied, so we compare the result from COUNTIF to 3 directly. The result will be TRUE or FALSE.
The second requirement is to have at least 15 volunteer hours in total. This requirement is tested with a simple logical expression based on the SUM function:
SUM(C6:E6)>=15)
Here, we use SUM to add up all ours in the range C6:C15 then we compare the result to the number 15 with the greater than or equal to operator (>=). As long as the sum is at least 15, this expression will return TRUE.
Finally the results from the two expressions above are evaluated by the AND function. If both the logical expressions return TRUE, the AND function will return TRUE. If either expression returns FALSE, AND will return FALSE.