I'm trying to calculate the average of the previous 3 and 10 instances, but I don't want to change the order

PETERFT73

New Member
Joined
Oct 31, 2017
Messages
12
I have what I consider to be an enormous dataset (approx 150k rows) of NBA player game logs. I'm trying to show the average of the player's previous 3 and 10 game performances. Where I think the real difficulty came up for me is that I would rather not re-arrange the data by changing it to alphabetical order by player name (currently in chronological order). With days off, it can be over 100 rows between a given player's entries. What I'm ultimately after is to change the whole set so that on a given day none of that day's actual statistics appear, but rather the past 3 day/10 day averages of those statistics. I tried to paste in a few rows down below in case that might help someone better see what I'm up against here.
Thanks in advance to any of you who offer some help!
Peter




gmDateteamAbbrteamLoc teamDayOff playDispNmplayStatMINPOSHGTWHTBDAYplayPTSplayASTplayTOplaySTLplayBLKplayPFplayFGAplayFGMplayFG%play2PAplay2PMplay2P%DKplay3PAplay3PMplay3P%playFTAplayFTMplayFT%playORBplayDRBplayTRBopptAbbropptConfopptDivopptLocopptRsltopptDayOff
10/30/12WASAway0 A.J. PriceStarter29PG7419510/7/867610011320.153840019920.2222111112CLEEastCentralHomeWin0
10/30/12WASAway0 Trevor ArizaStarter25SG802006/30/85940320830.375410.2529.75420.5210.5123CLEEastCentralHomeWin0

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col span="28"></colgroup><tbody>
</tbody>
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi Peter,
starting with structure: I'd keep the original data and make new columns/sheets with the 3d/10d averages, don't overwrite it. Having said that, you could use AVERAGESIFS to achieve what you want, see e.g. this for a tutorial: https://exceljet.net/formula/average-by-month . The main issue will be performance, as 150k of rows of formulas will take a very long time to recalculate. So what you could do is not using the whole dataset in calculations, but a range which will include what you're looking for. That, and/or only calculating 10k rows at once or a macro to do that for you.
Hope that helps,
Koen
 
Upvote 0

Forum statistics

Threads
1,215,328
Messages
6,124,299
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top