I am trying to sum one column of numbers in Excel where the same text value is in Column A up until the sum of values in column C = 0. Here is an example:
A B C D
1 Issue Action quantity Net
2 NFLX Buy 25 some amount
3 NFLX Sell -25 some amount
4 NFLX Buy 50 some amount
5 NFLX Sell -25 some amount
6 NFLX Sell -25 some amount
7 NFLX Buy 50 some amount
8 AMZN Buy 50 some amount
9 AMZN Sell -50 some amount
What I want to do is sum column D if the value of column A is the same up until the sum of column C is zero. I know I can use SUMIF to sum column D for the same values of column A. What I am not sure about is how to include the condition that the sum of all the values in column C from this row up above = 0. The summing would stop as soon as it reaches 0.
In the example above, it would sum rows 2-3, then rows 4-7, then rows 8-9.