# Thread: Cumulative sum with data in unequal increments Thanks: 0 Likes: 0

1. ## Cumulative sum with data in unequal increments

Dear All,

I would like to calculate the cumulative volume of liquid from a pipe over the period of 22 years. Data has been given on a daily basis, however in some instances this covers multiple days.

The format of the native data is as follows:

 DAY LIQUID RATE, M3/D CUMULATIVE VOLUME, M3 1 202 = 202 2 210 = 210 + 202 3 215 = 215 + 210 + 202 13 280 = 280 + (215 * (13 - 3)) + 210 + 202 30 330 = 330 + (280 * (30 - 13))+ (215 * (13 - 3)) + 210 + 202 etc etc etc

The issue starts on day 3 where the daily flowrate of 215 continues through to day 13, which then increases to 280 per day until day 30.

Does anyone know how this can be neatly calculated in a formula which I can replicate down. The data has 10,000 + rows so adding intermediate rows to cover each individual days is impractical.  Reply With Quote

2. ## Re: Cumulative sum with data in unequal increments

ABC
1DAYLIQUID RATE, M3/DCUMULATIVE VOLUME, M3
21202202
32210412
43215627
5132802842
6303307652

Planner

Worksheet Formulas
CellFormula
C2=B2
C3=B2*(A3-A2-1)+B3+C2  Reply With Quote

## User Tag List

array, cumulative, data, day, sum 