Link to Google Sheet : https://docs.google.com/spreadsheets/d/1e6FWnOfwzSXr6DaDvdo7Ruw_4qy9C0YUmvJlEfoQLCU/edit?usp=sharing
What I need ? I have data in column A only. From A2 to A97. In B2, B3 etc etc, I want a formula that adds value in Column A from that particular Row and onwards until the value 100% is reached or breached. I found one formula (given below) for Count from elsewhere in Stackoverflow, but it works fine for certain rows and not others. ( this formula was suggested by the user @Jeeped )
=MAX(INDEX((SUBTOTAL(9,OFFSET(A2, 0,0,ROW($1:$99),1))<=100%)*ROW($1:$99),,))+1
( if i want to copy this formula down, in all the subsequent rows, will it work ? ).
Please help me with where I am going wrong. Thanks in advance !
100% ( should be reached or breached; then give output - Sum as well
as Count )
30% 8 Takes This and NEXT 7 rows to reach or breach 100%
-65% 7 Takes This and NEXT 6 rows to reach or breach 100% 30% 6 10% 5 10% 4
-27% 3 44% 2 198% 1 This is correct 250% 5 This is wrong. 240% is already greater than 100%. So the result should be "1".
-65% 11
-28% 8
-94% 6 125% 5 This is wrong. 128% is already greater than 100%. So the result should be "1".
-18% 5 75% 3
-99% 5 135% 1 44% 3
-8% 2 250% 1
-19% 18 This is wrong. It should be 5.
-78% 17 116% 16
-44% 15 183% 14 This is wrong 28% 17 4% 16
-84% 15 40% 14
-7% 13
-96% 12
-53% 9 163% 6 Wrong
-81% 9
-30% 6
-31% 5
-65% 2 237% 1
-57% 4 164% 3 Wrong
-87% 4 116% 1 62% 2 173% 30 53% 41 39% 100 Why 100 from here on ?
-6% 100
-51% 100 138% 38
-14% 100 259% 100
-51% 100 44% 100
-94% 100
-85% 100
-25% 100
-10% 100 104% 100 76% 100
-61% 100 86% 100 87% 100
-14% 100
-68% 100
-95% 100
-100% 100
-94% 100 75% 100
-78% 100
-92% 100
-78% 15 This should be 4
-78% 12 150% 1 150% 12