nirav vaniya
nirav vaniya

Reputation: 1

Excel formula (count a number of cell equal to my value)

Excel formula need

I need to count a number of cells in selected column area which sums equal to my prefix value, sum must be counted top to bottom.

Excel formula need

I need to count a number of cells in selected column area which sums equal to my prefix value, sum must be counted top to bottom.
Ex.(prefix value = 88)

23
35
36
67
80

(Upper column is selected)

And if prefix value is grater then all selected cells then result is 5 (total cells)

So i need a result = 3

That's a number of cells which sum equal or include my prefix value.

Upvotes: 0

Views: 35

Answers (1)

Scott Craner
Scott Craner

Reputation: 152505

With Office 365 we can use SCAN to do a dynamic sum and find where it passes the threshold.

=LET(rng,A1:A5,pf,B1,MIN(SUM(--(SCAN(0,rng,LAMBDA(a,b,a+b))<pf))+1,COUNT(rng)))

enter image description here

Upvotes: 1

Related Questions