Count If function

chatnet26

Board Regular
Joined
Aug 25, 2011
Messages
59
Dear Guru,

We have one excel file for monitoring of action items generated by the management after the study. As since there were around 3000+ rows has been generated since in the beginning of 1990's till to-date. So I was thinking of instead of getting the result through filter manually, I want to create a formula that will count of how many has been closed this year and this month out of the total numbers of action items.

Is it possible to use the COUNTIF function formula to count the number of items in column A, and date of column B, and closed in column C.

In below, we can see that there were 4 items under Revalidation has been closed this month and the total number of closed this year is 6.

TYPEMTD Closing DateStatus
Project2-Jan-13Closed
Project2-Jan-13Closed
Project5-Jan-13Closed
Project19-Feb-13Closed
Project16-Feb-13Closed
Revalidation22-Feb-14Closed
Revalidation2-Feb-14Closed
Revalidation5-Mar-14Closed
Revalidation8-Mar-14Closed
Revalidation10-Mar-14Closed
Revalidation15-Mar-14Closed

<colgroup><col><col><col></colgroup><tbody>
</tbody>

<colgroup><col><col><col></colgroup><tbody></tbody>

Appreciated you valuable response. Thanks

Best Regards,
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi,

Many thanks to your quick response, however if u can suggest the way I should introduce as am not really an expert of excel specially you told pivot table. So if the countif function can perform that would be better.

Best regards,
 
Upvote 0
Hopefully I understood this right. You can use SUMPRODUCT to do this.

If you data starts at cell A1, make table at E1 as follows

EFGH
120132014March
2Project500
3Revalidation064

<tbody>
</tbody>

formula in F2 is =SUMPRODUCT(($A$2:$A$12=$E2)*(YEAR($B$2:$B$12)=F$1)*($C$2:$C$12="Closed")). Copy this to include F2:G3

formula in H2 =SUMPRODUCT(($A$2:$A$12=$E2)*(TEXT($B$2:$B$12,"mmmm")=H$1)*($C$2:$C$12="Closed")), copy to H3

This should get you going I think. You can extend it as required, for example the month in H1 could be a drop down pick list.

Hope this helps.
 
Upvote 0
It can be done with SUMPRODUCT as above (or SUMIFS if you're using 2010). The advantage of a pivot table is that it doesn't require you to maintain a list of all possible categories. It depends on the complexity of your data as to which will suit best.

If you're new to pivot tables then Debra Dalgleish has a really helpful website.
 
Upvote 0
Hi gazz,

Many thanks to your valuable response. It is definitely met my requirements. Appreciated so much, again thank you. :)

God Bless.

Best Regards,
 
Upvote 0
Hi Emma,

I will go through the link you have provided and thank you with your kind assistance and input.

God Bless.

Best Regards,
 
Upvote 0
Hi gazz,

I found a bit problem in the formula of counting the current month because it will read/count which has been closed even in the previous years that falls to the month of March. It gives me a total of 581.

I need your help please to figure it out. Thanks

Best Regards,
 
Upvote 0
TYPE
MTD Closing DateStatus
3/8/2014This MonthThis Year
Project2-Jan-13Closed
Project00
Project2-Jan-13Closed
Revalidation46
Project
5-Jan-13Closed



Project19-Feb-13Closed



Project16-Feb-13Closed



Revalidation22-Feb-14Closed



Revalidation2-Feb-14Closed



Revalidation5-Mar-14Closed



Revalidation8-Mar-14Closed



Revalidation10-Mar-14Closed



Revalidation15-Mar-14Closed




<tbody>
</tbody>

E2:
Rich (BB code):
=TODAY()
F2, copied down:
Rich (BB code):
=COUNTIFS(
  $A$2:$A$12,E2,
  $B$2:$B$12,">="&$E$1-DAY($E$1)+1,
  $B$2:$B$12,"<="&EOMONTH($E$1,0),
  $C$2:$C$12,"closed")
G2, copied down:
Rich (BB code):
=COUNTIFS(
  $A$2:$A$12,E2,
  $B$2:$B$12,">="&"1-Jan-"&YEAR($E$1),
  $B$2:$B$12,"<="&"31-Dec-"&YEAR($E$1),
  $C$2:$C$12,"closed")
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,052
Latest member
Fuddy_Duddy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top