Home > Back-end >  Cumulative sum in excel with certain criteria
Cumulative sum in excel with certain criteria

Time:06-23

I have typed out an equation that I have dragged it down in a column in my excel table. I think I’m fairly close… and would love some feedback around this.

I want cumulative sum of the first cell $J$3 to the cell row it’s currently on (J53 for example). And I want cumulative sum of the particular cells that meet these conditions (ie… COUNTIF($B$3:B53,B53)*COUNTIF(AC53,1).

I know the Sumif() statement below isn’t correct… but this was as close as I could get!

=IF((COUNTIF($B$3:B53,B53)*COUNTIF(AC53,1)),(SUMIF($J$3:J53,J53)),0)

As shown in the table below

Projectid(B) successornot(AC) production(J) result I want
1 1 20 20
1 1 40 60
1 1 10 70
2 0 20 0
2 0 400 0
3 1 20 20
4 0 1 0
5 0 24 0
6 0 50 0
7 1 10 10
7 1 40 50
7 1 20 70

CodePudding user response:

Give a try on

=IF(B2=0,0,SUMIFS($C$2:$C2,$A$2:$A2,A2,$B$2:$B2,">0"))

enter image description here

  • Related