Is there a way to sum a group of items based on when a field changes to something specific and number of rows will vary. Sample data below... I'd like to be able to sum the "Data" numbers whenever the indicator "Flag" changes to "0". So in the example, I'd subtotal 6+5 for 11, then just 6 for the next subtotal, then 7+6+8+1 for the next subtotal of 22 and so on. Whenever the indicator flag changes to "0", that signifies the next group for subtotaling. The number of rows to subtotal can vary, so it's not something that the Sample tool can account for.
Thanks for any input!
Data | Flag |
6 | 0 |
5 | 1 |
6 | 0 |
7 | 0 |
6 | 1 |
8 | 2 |
1 | 3 |
5 | 0 |
6 | 1 |
4 | 2 |
5 | 2 |
6 | 0 |
Solved! Go to Solution.