researcher

Dear All,

I’m pretty new to Excel and appreciate any guidance regarding the following issue that I encounter; In the following, I have a row (in orange) of numbers; What I want to be in the second row (in blue) is the sum of the last “X” number of elements; Meaning that for X=4, as long as the number of values in the first row is less than X=4, the second row will show the sum of the non empty cells in the first row and once the X+1 cell (5 for this example) gets filled with a value, the very first entry in the first row is subtracted from the sum; for the next coming value in cell X+2 of the first row, the second entry in the first row is subtracted from the sum and so on.

Hence, we have a moving average of sum of last X number of elements shown in the second row and in case the number of elements in the first row is less than X it doesn’t give an error but instead sum of the available entries.

 

1 2 3 4 5 6 7 8 9 10  
1=1 3=1+2 6=3+3 10=6+4 14=10+5-1 18=14+6-2 22 26 30 34  
                     

 

What is the fucntion doing this moving accumulated sum of the last X elements?

Thanks beforehand for any help.

Best,
Mary.

By: mary

Leave a Reply

Your email address will not be published. Required fields are marked *