对行进行计数,直到行的总和值大于值

时间:2022-09-24 00:17:13

I want to count how many rows have the sum value no greater than X.

我想计算有多少行的和值不大于X.

Same as this Sum until certain point - MySql but just with an excel formula and only the row count. Using the same examples as in the above, first limit should give the value 2 and the second 4.

与此Sum相同,直到某一点 - MySql,但只有excel公式,只有行数。使用与上面相同的示例,第一个限制应该给出值2和第二个4。

1 个解决方案

#1


It's easy to do by adding an extra column. In that column you would keep a running total by filling down the a formula like this

通过添加额外的列很容易做到。在该列中,您将通过填写这样的公式来保持运行总计

Imagining your data has a header row in row 1 and is in A1 to C6 put this in D2 and fill down

想象你的数据在第1行有一个标题行,在A1到C6中把它放在D2中并填充

=SUM($C$2:C2)

Then in E2 put this

然后在E2中放这个

=COUNTIF(D2:D6,"<500")

Changing the number 500 will give you a different limit.

更改数字500将为您提供不同的限制。

#1


It's easy to do by adding an extra column. In that column you would keep a running total by filling down the a formula like this

通过添加额外的列很容易做到。在该列中,您将通过填写这样的公式来保持运行总计

Imagining your data has a header row in row 1 and is in A1 to C6 put this in D2 and fill down

想象你的数据在第1行有一个标题行,在A1到C6中把它放在D2中并填充

=SUM($C$2:C2)

Then in E2 put this

然后在E2中放这个

=COUNTIF(D2:D6,"<500")

Changing the number 500 will give you a different limit.

更改数字500将为您提供不同的限制。