I have been working on an Excel sheet of school attendance. I have already asked a question about that attendance. Now I have a different situation. I have both “boy(B)/girl(G)” students in Gender section. I also have a Category section having 5 different categories. Now I have dates corresponding to each name of the students where a teacher puts either a “P” or an “A”. Please loot into the image:
I need to count total number of students on below conditions:
- How many boys were present (at least 1 day) in a month?
- How many girl were present (at least 1 day) in a month?
- How many boys in each category were present (at least 1 day) in a month?
- How many girls in each category were present (at least 1 day) in a month?
Kindly note that the names of the students are not unique.
Please help !
EDIT:
I tried to count "total number of male students (B - in my case) attended at least 1 class in this way:
=COUNTIFS(D5:D49,"B",F5:AJ49,"P")
But it is throwing an error.
EDIT:
Thank you all for the responses. But I guess I did not able to make my point clearly.
Here I want to count "How many students were present in all cases and not "how many times each student was present", i.e. I need to count student in all cases who went to school even a single day. So if a student was present let’s say 20 days in a month, the total number will be 1 and not 20.
I hope I made things clear now.
EDIT:
Thank you guys for the help. I have accomplished the task by adding an extra column which returns a 1 if there is any "P" in the date row by using:
=IF((COUNTIF(G5:AK5,"P"))>0,1,0)
Then I am using a COUNTIFS with multiple conditions which checks and count if the extra cell (above) have a value of 1 and checks the Gender and Category row and count it:
=COUNTIFS(C5:C27,">0", E5:E27,"G", F5:F27,"CAT1")
Though, I don't want to use the extra cell as it is not needed for attendance purpose. So I asked a different question here