简体   繁体   English

excel中的累计和一定的标准

[英]Cumulative sum in excel with certain criteria

I have typed out an equation that I have dragged it down in a column in my excel table.我已经输入了一个方程式,我将它拖到了我的 Excel 表格的一列中。 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).我想要第一个单元格$J$3的累积总和到它当前所在的单元格行(例如J53 )。 And I want cumulative sum of the particular cells that meet these conditions (ie… COUNTIF($B$3:B53,B53)*COUNTIF(AC53,1) .我想要满足这些条件的特定单元格的累积总和(即…… 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!我知道下面的Sumif()语句是不正确的……但这已经尽可能接近了!

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

As shown in the table below如下表所示

Projectid(B)投影(B) successornot(AC)继任者(AC) production(J)生产(J) result I want我想要的结果
1 1 1 1 20 20 20 20
1 1 1 1 40 40 60 60
1 1 1 1 10 10 70 70
2 2 0 0 20 20 0 0
2 2 0 0 400 400 0 0
3 3 1 1 20 20 20 20
4 4 0 0 1 1 0 0
5 5 0 0 24 24 0 0
6 6 0 0 50 50 0 0
7 7 1 1 10 10 10 10
7 7 1 1 40 40 50 50
7 7 1 1 20 20 70 70

Give a try on试一试

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

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM