YahooGoogle
New Member
- Joined
- Nov 7, 2017
- Messages
- 14
- Office Version
- 2007
I have a file that has two columns "Where" and "Region". I also have a "Sales" column: What I would like to know is how to:
a. take the average number of "Sales" that are only from the "East" and only the last 5 numbers, meaning that as I add numbers to my file, it will continue to average only the last 5 sales numbers (so including the new numbers as they are added which in turn would remove the older numbers from the calculations)
b. take the average number of "Sales" to reflect both the "East" and "Away" (so using two columns). Again, as in point a above, I would like only the average of the last 5 sales numbers in the file
[TABLE="width: 249"]
<tbody>[TR]
[/TR]
[TR]
[TD]Here is an example of my file:
[TABLE="width: 313"]
<tbody>[TR]
[TD][/TD]
[TD]Column F
[/TD]
[TD]Column G
[/TD]
[TD]Column H
[/TD]
[/TR]
[TR]
[TD]Row 1[/TD]
[TD]Sales
[/TD]
[TD]Where
[/TD]
[TD]Region
[/TD]
[/TR]
[TR]
[TD]Row 2[/TD]
[TD]22[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 3[/TD]
[TD]17[/TD]
[TD]home[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 4[/TD]
[TD]21[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 5[/TD]
[TD]20[/TD]
[TD]home[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 6[/TD]
[TD]24[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 7[/TD]
[TD]24[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 8[/TD]
[TD]24[/TD]
[TD]home[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 9[/TD]
[TD]22[/TD]
[TD]home[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 10[/TD]
[TD]25[/TD]
[TD]away[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 11[/TD]
[TD]11[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 12[/TD]
[TD]35[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 13[/TD]
[TD]9[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 14[/TD]
[TD]13[/TD]
[TD]home[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 15[/TD]
[TD]17[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 16[/TD]
[TD]13[/TD]
[TD]home[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 17[/TD]
[TD]27[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 18[/TD]
[TD]12[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 19[/TD]
[TD]14[/TD]
[TD]home[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 20[/TD]
[TD]7[/TD]
[TD]home[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 21[/TD]
[TD]20[/TD]
[TD]away[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 22[/TD]
[TD]14[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 23[/TD]
[TD]15[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]For point A, I tried using something like: =AVERAGEIF(H:H,H2,OFFSET(F1,COUNT(F:F),0,-5))
but the end result wasn't accurate. I can't even begin to imagine where to start for point B
Any help would be greatly appreciated!
Thanks[/TD]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
a. take the average number of "Sales" that are only from the "East" and only the last 5 numbers, meaning that as I add numbers to my file, it will continue to average only the last 5 sales numbers (so including the new numbers as they are added which in turn would remove the older numbers from the calculations)
b. take the average number of "Sales" to reflect both the "East" and "Away" (so using two columns). Again, as in point a above, I would like only the average of the last 5 sales numbers in the file
[TABLE="width: 249"]
<tbody>[TR]
[/TR]
[TR]
[TD]Here is an example of my file:
[TABLE="width: 313"]
<tbody>[TR]
[TD][/TD]
[TD]Column F
[/TD]
[TD]Column G
[/TD]
[TD]Column H
[/TD]
[/TR]
[TR]
[TD]Row 1[/TD]
[TD]Sales
[/TD]
[TD]Where
[/TD]
[TD]Region
[/TD]
[/TR]
[TR]
[TD]Row 2[/TD]
[TD]22[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 3[/TD]
[TD]17[/TD]
[TD]home[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 4[/TD]
[TD]21[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 5[/TD]
[TD]20[/TD]
[TD]home[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 6[/TD]
[TD]24[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 7[/TD]
[TD]24[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 8[/TD]
[TD]24[/TD]
[TD]home[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 9[/TD]
[TD]22[/TD]
[TD]home[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 10[/TD]
[TD]25[/TD]
[TD]away[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 11[/TD]
[TD]11[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 12[/TD]
[TD]35[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 13[/TD]
[TD]9[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 14[/TD]
[TD]13[/TD]
[TD]home[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 15[/TD]
[TD]17[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 16[/TD]
[TD]13[/TD]
[TD]home[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 17[/TD]
[TD]27[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 18[/TD]
[TD]12[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 19[/TD]
[TD]14[/TD]
[TD]home[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 20[/TD]
[TD]7[/TD]
[TD]home[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 21[/TD]
[TD]20[/TD]
[TD]away[/TD]
[TD]west[/TD]
[/TR]
[TR]
[TD]Row 22[/TD]
[TD]14[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
[TR]
[TD]Row 23[/TD]
[TD]15[/TD]
[TD]away[/TD]
[TD]east[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]For point A, I tried using something like: =AVERAGEIF(H:H,H2,OFFSET(F1,COUNT(F:F),0,-5))
but the end result wasn't accurate. I can't even begin to imagine where to start for point B
Any help would be greatly appreciated!
Thanks[/TD]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]