3. The COUNTIFS function
1. In the three worksheets containing data, identify the variable that represents cardiovascular (heart or circulatory) conditions (HINT: Use your "metadata" sheet to help you, if needed).
2. In your "calculations" worksheet, calculate the count and prevalence (%) of cardiovascular conditions for males and females separately, and for the total cohort.
To do this, you will need to use the COUNTIFS formula - this is an extension of the COUNTIF formula used in Part 1 of this module. The COUNTIFS formula allows the calculation of counts where multiple conditions are met (e.g., having a cardiovascular condition AND being male).
The formula structure is as follows:
=countifs(range1,criteria1,range2,criteria2)
e.g., we want to calculate the number of males who have reported having a cardiovascular condition. To do this, we need to count the number of participants meeting both the criteria for being male (range = sex variable column, criteria = 1 (male)) and having a cardiovascular condition (range = cvcondition variable column, criteria = 1 (yes)):
=COUNTIFS(C2:C307,1,AX2:AX307,1)
3. Create a summary table in your "summary table" worksheet, and enter the count and prevalence (%) of cardiovascular conditions for men, women and the total cohort, as well as the total count of 2016 Health and Society Student Health Survey participants.