I am trying to add the numbers in column 1 together into column 3 when the numbers in column 2 are the same, however, only when they are touching or directly beneath/above each other. If that same number comes again down the line, I would like it treated as a new number. It is possible that column 2 may have up to 7 of the same number in a row. Any ideas?
I would like column 3 to be a formula to do this.
100 | 1 | 400 |
300 | 1 | |
200 | 2 | 200 |
50 | 3 | 50 |
80 | 1 | 80 |
70 | 2 | 150 |
30 | 2 | |
50 | 2 | |
40 | 7 | 40 |
120 | 3 | 120 |
I would like column 3 to be a formula to do this.