Home » excel » Excel Summing Formula setting against month date using SUMPRODUCT

Excel Summing Formula setting against month date using SUMPRODUCT

Posted by: admin April 23, 2020 Leave a comment

Questions:

I am trying sum rows that have the same month date. I have a formula that operates with columns but fails when rows are requested. I will show the formulas that I have tried, but I am now stuck. Any advise would be much appreciated.

=SUMPRODUCT(--(MONTH($A$9:$A$50)=5),$B$9:$B$50) 

This array works fine with a column

=SUMPRODUCT(--(MONTH($A$9:$A$50)=5),$B$9:**$H$50**) 

see the bold reference which comprises a series of cells set out in rows.

How to&Answers:

SUMPRODUCT normally expects ranges to be the same size but you can get the result you need with a change to the syntax, i.e.

=SUMPRODUCT((MONTH($A$9:$A$50)=5)*$B$9:$H$50)

You can’t have any text in B9:H50 otherwise you will get #VALUE! error. If you do have text in that range then you can use this version, which should ignore the text and give you a result

=SUMPRODUCT((MONTH($A$9:$A$50)=5)*ISNUMBER($B$9:$H$50),$B$9:$H$50)