i want calculate sum of numbers from a1 to any row when total equal or grater than d1.
for example in up image ,B2+B3+B4+B5 is our answer.
Book1 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Customer | Purchase | 500 | ||||
2 | a | 221 | 221 | b | Customer b in Column A when Sum reaches 500+ | ||
3 | a | 150 | 371 | 4 | Row 4 in Column B (Not including Header row) when Sum reaches 500+, meaning 340 | ||
4 | a | 95 | 466 | $A$5 | Cell address of Customer when Sum reaches 500+ | ||
5 | b | 340 | 806 | $B$5 | Cell address of Purchase when Sum reaches 500+ | ||
6 | c | 439 | 1245 | ||||
7 | c | 233 | 1478 | ||||
8 | c | 208 | 1686 | ||||
9 | c | 240 | 1926 | ||||
10 | c | 263 | 2189 | ||||
11 | d | 299 | 2488 | ||||
Sheet165 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2 | =SUM(B$2:B2) | |
D2 | =INDEX(A2:A11,MATCH(D1,C2:C11,1)+1) | |
D3 | =MATCH(D1,C2:C11,1)+1 | |
D4 | =CELL("address",INDEX(A2:A11,MATCH(D1,C2:C11,1)+1)) | |
D5 | =CELL("address",INDEX(B2:B11,MATCH(D1,C2:C11,1)+1)) |