Countif Month for Attendance Sheet

NCF11

New Member
Joined
Oct 29, 2019
Messages
1
I am making an attendance sheet to count the number of times a person is present in a certain month. (url to photo of sheet attached)

Column A is Dates, and Columns C-D lists "yes" if present on that date and "no" if not present on that date.

Column G lists months (Feb, Mar, April..), and in Columns I-K, I want to count the number of times "yes" appears in the corresponding column in a certain month.

I am having trouble using the Month() function inside the Countifs() function.

-Thanks!

NCF


EDIT: Sorry, this is the url to the photo: https://postimg.cc/QVjb3X57

 
Last edited by a moderator:

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
8,784
Welcome to the Board!

You can't use MONTH() inside a COUNTIFS functions, at least not the way you're envisioning. Instead you need to create 2 conditions, one for the start date, and one for the end date. If your dates in column G are actually the 1st of each month, then try:

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th><th>H</th><th>I</th><th>J</th><th>K</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">Person</td><td style=";">Person</td><td style=";">Person</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">Person</td><td style=";">Person</td><td style=";">Person</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">Date</td><td style="text-align: right;;"></td><td style="text-align: right;;">1</td><td style="text-align: right;;">2</td><td style="text-align: right;;">3</td><td style="text-align: right;;"></td><td style=";">Date</td><td style="text-align: right;;"></td><td style="text-align: right;;">1</td><td style="text-align: right;;">2</td><td style="text-align: right;;">3</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style="text-align: right;;">4-Feb-19</td><td style="text-align: right;;"></td><td style=";">No</td><td style=";">Yes</td><td style=";">Yes</td><td style="text-align: right;;"></td><td style="text-align: right;;">Feb-19</td><td style="text-align: right;;"></td><td style="text-align: right;;">0</td><td style="text-align: right;;">2</td><td style="text-align: right;;">2</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style="text-align: right;;">11-Feb-19</td><td style="text-align: right;;"></td><td style=";">No</td><td style=";">Yes</td><td style=";">Yes</td><td style="text-align: right;;"></td><td style="text-align: right;;">Mar-19</td><td style="text-align: right;;"></td><td style="text-align: right;;">0</td><td style="text-align: right;;">2</td><td style="text-align: right;;">2</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style="text-align: right;;">11-Mar-19</td><td style="text-align: right;;"></td><td style=";">No</td><td style=";">Yes</td><td style=";">Yes</td><td style="text-align: right;;"></td><td style="text-align: right;;">Apr-19</td><td style="text-align: right;;"></td><td style="text-align: right;;">0</td><td style="text-align: right;;">3</td><td style="text-align: right;;">3</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">7</td><td style="text-align: right;;">21-Mar-19</td><td style="text-align: right;;"></td><td style=";">No</td><td style=";">Yes</td><td style=";">Yes</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">8</td><td style="text-align: right;;">1-Apr-19</td><td style="text-align: right;;"></td><td style=";">No</td><td style=";">Yes</td><td style=";">Yes</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">9</td><td style="text-align: right;;">22-Apr-19</td><td style="text-align: right;;"></td><td style=";">No</td><td style=";">Yes</td><td style=";">Yes</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">10</td><td style="text-align: right;;">29-Apr-19</td><td style="text-align: right;;"></td><td style=";">No</td><td style=";">Yes</td><td style=";">Yes</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">I4</th><td style="text-align:left">=COUNTIFS(<font color="Blue">$A:$A,">="&$G4,$A:$A,"<="&EOMONTH(<font color="Red">$G4,0</font>),INDEX(<font color="Red">$C:$E,0,MATCH(<font color="Green">I$2,$C$2:$E$2,0</font>)</font>),"Yes"</font>)</td></tr></tbody></table></td></tr></table><br />

If you want to use MONTH(), then you could use SUMPRODUCT instead of COUNTIFS, but that requires a different approach.
 

Forum statistics

Threads
1,077,688
Messages
5,335,666
Members
399,033
Latest member
thefinu

Some videos you may like

This Week's Hot Topics

Top