Count If January AND "G"

gri96

New Member
Joined
Mar 19, 2021
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
I've drawn a blank.

Column A = Dates (DD/MM/YYYY)
Column M = RAG Status ("R" or "A" or "G")

I need to count up all of the R's in January, all of the A's in January, and all of the G's in January.
And so on for the other months.

I've got
Excel Formula:
=SUMPRODUCT( --ISNUMBER(Table1[Monthly schedule - Planned Date]), --(MONTH(Table1[Monthly schedule - Planned Date]) = 1))
Which returns a count of all of the 'January' 's.

I've also got
Excel Formula:
=COUNTIF(Table1[RAG STATUS],"G")
Which returns all of the 'G' 's - but for the entire table.

I kinda need a combo of the two?
I was playing with
Excel Formula:
=COUNTIFS(Table1[Monthly schedule - Planned Date], SUMPRODUCT( --ISNUMBER(Table1[Monthly schedule - Planned Date]), --(MONTH(Table1[Monthly schedule - Planned Date]) = 1)),Table1[RAG STATUS],"G")

But that isn't quite hitting it... Any advice is appreciated!!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Welcome to the board!

Your last try was so close. You were just thinking too complicated. The syntax is =COUNTIFS (range1, criteria1, [range2], [criteria2], ...) so all your need to do is give it a range and then the criteria:
Excel Formula:
=COUNTIFS(Month Range, Month, Letter Range, Letter)
Read a full tutorial.
 
Upvote 0
Thanks for the swift reply!
So I tried that
Excel Formula:
=COUNTIFS(Table1[Monthly schedule - Planned Date], "JANUARY", Table1[RAG STATUS], "G")

with and without quotations, but it returns 0 ?
OR... Am I being really dense now
 
Upvote 0
Turns out I needed SUMPRODUCT!

Excel Formula:
=SUMPRODUCT( --(MONTH(Table1[Monthly schedule - Planned Date]) = 1)*(Table1[RAG STATUS]="G"))

Seems to have worked!
 
Upvote 0
Try this formula for "R"
Excel Formula:
=SUMPRODUCT(--(MONTH(Table1[Monthly schedule - Planned Date])=1),--(Table1[RAG STATUS]="R"))
and change for other codes.


EDIT: See you just figured this out and posted!
Yes, because you need to apply the month function to your entire range, you need to use SUMPRODUCT instead of COUNTIFS.
 
Upvote 0
Solution
Sorry. You are right: You can't use MONTH() with COUNTIFS range where as SUMPRODUCT has no problem doing so.
 
Upvote 0
You are welcome.
Glad we were able to help (and happy to see that you were also able to come up with a solution on your own!).
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

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