• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Count of a number occurence by month

Gandalf

Member
Hi

Could anyone help me. I am trying to write a formula to count how many times a particular number occurs any particular month. I have tried using both the countifs and aggregate formulas and either Excel stops me entering the formula or gives an error message. I've attached a part of the spreadsheet (with a comment) if that would help.

Many thanks

Gandalf
 

Attachments

  • test aggregate.xlsx
    23.5 KB · Views: 5
Try this old school formula way,

In K2, formula copied across and down :

=SUMPRODUCT((MONTH($A$2:$A$358)=MONTH(1&K$1))*COUNTIF(OFFSET($B$1:$F$1,ROW($B$2:$F$358)-ROW($B$1),0),$J2))

77870
 

Attachments

  • test aggregate(BY).xlsx
    26.9 KB · Views: 8
In the attached, 2 offerings:
1. Formula only, see cell K2:
=SUMPRODUCT(--(IF(MONTH($A$2:$A$358)=MONTH(K$1),--($B$2:$F$358))=$J2))
copy down and across.
HOWEVER... note that in cells K1:V1, instead of the literal names of the months I've used actual dates but (a) only show the month in the top row and (b) in the formulae I only refer to the month of those dates in row 1, so the year there doesn't matter.
[edit post posting - bosco beat me to it!]

2. A Power Query solution which outputs to a pivot table at cell Y1.

Both seem to give the same answers, but check thoroughly.
 

Attachments

  • Chandoo47619test aggregate.xlsx
    51.6 KB · Views: 5
Last edited:
Back
Top