tags:

views:

302

answers:

1

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

Same as this http://stackoverflow.com/questions/839704/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.

+1  A: 

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.

Alex Andronov