Marycrawford
New Member
- Joined
- Nov 28, 2017
- Messages
- 5
[FONT="]Dear All,[/FONT]
[FONT="]I’m pretty new to Excel and appreciate any guidance regarding the following issue that I encounter;
In the following, I have a row of numbers; What I want to be in the second row 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.[/FONT]
[FONT="]Hence, we have a moving average of the 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.
[/FONT]
<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
Thanks in advance for any guidance.
[FONT="]I’m pretty new to Excel and appreciate any guidance regarding the following issue that I encounter;
In the following, I have a row of numbers; What I want to be in the second row 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.[/FONT]
[FONT="]Hence, we have a moving average of the 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.
[/FONT]
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=18+7-3 | 26=22+8-4 | 30=26+9-5 | 34=30+10-6 |
<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
Thanks in advance for any guidance.