Count rows until the sum value of the rows is grea

2019-09-19 23:48发布

I want to count how many rows have the sum value no greater than 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.

标签: excel
1条回答
来,给爷笑一个
2楼-- · 2019-09-20 00:42

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

=SUM($C$2:C2)

Then in E2 put this

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

Changing the number 500 will give you a different limit.

查看更多
登录 后发表回答