How to SUM just positive values in month x

Jarke

Board Regular
Joined
Aug 13, 2016
Messages
95
Hi brilliant people!

I want to sum just the positive transactions in a month, my current code to sum the result of the month is =SUMPRODUCT((MONTH(Logg!$C$24:$BN$24)=C75)*(YEAR(Logg!$C$24:$BN$24)=2016)*(Logg!$C$60:$BN$60))

But i want to sum only the positive numbers, to later get an average of it. My values are in Row 60 and dates is in row 24.


Thanks alot for trying to help, appreciate all you can come up with, cheers
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try:
Code:
=SUMPRODUCT((MONTH(Logg!$C$24:$BN$24)=C75)*(YEAR(Logg!$C$24:$BN$24)=2016)*(Logg!$C$60:$BN$60>0),Logg!$C$60:$BN$60)
 
Upvote 0
Beautiful! Error first but changed the comma "," in the end of the code to a "*" and then it worked, Thanks alot!


To get the average of the positive transactions, i need to divide that code by a code that counts how many positive transaction it was in that same month, can you do this?

Thanks again!
 
Upvote 0
Beautiful! Error first but changed the comma "," in the end of the code to a "*" and then it worked, Thanks alot!


To get the average of the positive transactions, i need to divide that code by a code that counts how many positive transaction it was in that same month, can you do this?

Thanks again!
You should not need to replace the comma with a *.

For the count try this array formula:
Code:
=SUM(IF((MONTH(Logg!$C$24:$BN$24)=C75)*(YEAR(Logg!$C$24:$BN$24)=2016)*(Logg!$C$60:$BN$60>0),1,0))
CONFIRM with ctrl+shift+enter, not just enter.
 
Upvote 0

Forum statistics

Threads
1,216,309
Messages
6,130,001
Members
449,551
Latest member
MJS_53

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