I have a timeseries data set and am using what in my field we refer to as a digital filter to smooth the data. I have water level data and it can be quite noisy so the filter acts as a smoother. I use the following equation: (Summation( i = 1, 96, Lag( :Water, i ) ) +Summation( i = -1, 96, Lag( :Water, i ) )) / 192. The equation is looking forward 96 rows and backwards 96 rows and taking the average. The equation works just fine except for at the beginning of the dataset... for rows less than 96 it tails off to 0. How can I either adjust the equation or add to say If row < 96 then only take the average of row 1 through row i (i being a value between 2 and 95)