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]
[TABLE="width: 979"]
<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]7[/TD]
[TD]8[/TD]
[TD]9[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]1=1[/TD]
[TD]3=1+2[/TD]
[TD]6=3+3[/TD]
[TD]10=6+4[/TD]
[TD]14=10+5-1[/TD]
[TD]18=14+6-2[/TD]
[TD]22=18+7-3[/TD]
[TD]26=22+8-4[/TD]
[TD]30=26+9-5[/TD]
[TD]34=30+10-6[/TD]
[/TR]
</tbody>[/TABLE]
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]
[TABLE="width: 979"]
<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]7[/TD]
[TD]8[/TD]
[TD]9[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]1=1[/TD]
[TD]3=1+2[/TD]
[TD]6=3+3[/TD]
[TD]10=6+4[/TD]
[TD]14=10+5-1[/TD]
[TD]18=14+6-2[/TD]
[TD]22=18+7-3[/TD]
[TD]26=22+8-4[/TD]
[TD]30=26+9-5[/TD]
[TD]34=30+10-6[/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance for any guidance.