I'm trying to calculate an average of the last 5 days data at specific times (e.g. five days average at 11am, 12am, 1pm). The data is summed up cumulatively from the beginning of every day.
Please find a simplified example of what I am trying to achieve below:
[TABLE="class: grid, width: 348"]
<tbody>[TR]
[TD]Last 5 days average volume at 13:00
[/TD]
[TD="align: right"] Should be 16
[/TD]
[/TR]
[TR]
[TD]Last 5 days average volume at 12:00
[/TD]
[TD="align: right"]Should be 11
[/TD]
[/TR]
[TR]
[TD]Last 5 days average volume at 11:00
[/TD]
[TD="align: right"]Should be 7
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]Volume[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-18 13:00[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-18 12:00[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-18 11:00[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-17 13:00[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-17 12:00[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-17 11:00[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-16 13:00[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-16 12:00[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-16 11:00[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-15 13:00[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-15 12:00[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-15 11:00[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-14 13:00[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-14 12:00[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-14 11:00[/TD]
[TD="align: right"]8[/TD]
[/TR]
</tbody>[/TABLE]
To make matters more complicated, I have an Excel add-in that updates the data on an hourly basis and where older data is always shifted down along the list.
I've battled with AVERAGEIFS, but I'm having problems getting the criteria right with the date+time combination
I'm using MS Office 2010 on Windows 7.
Any help or alternative suggestions would be very much appreciated.
Please find a simplified example of what I am trying to achieve below:
[TABLE="class: grid, width: 348"]
<tbody>[TR]
[TD]Last 5 days average volume at 13:00
[/TD]
[TD="align: right"] Should be 16
[/TD]
[/TR]
[TR]
[TD]Last 5 days average volume at 12:00
[/TD]
[TD="align: right"]Should be 11
[/TD]
[/TR]
[TR]
[TD]Last 5 days average volume at 11:00
[/TD]
[TD="align: right"]Should be 7
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]Volume[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-18 13:00[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-18 12:00[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-18 11:00[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-17 13:00[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-17 12:00[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-17 11:00[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-16 13:00[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-16 12:00[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-16 11:00[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-15 13:00[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-15 12:00[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-15 11:00[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-14 13:00[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-14 12:00[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]2014-01-14 11:00[/TD]
[TD="align: right"]8[/TD]
[/TR]
</tbody>[/TABLE]
To make matters more complicated, I have an Excel add-in that updates the data on an hourly basis and where older data is always shifted down along the list.
I've battled with AVERAGEIFS, but I'm having problems getting the criteria right with the date+time combination
I'm using MS Office 2010 on Windows 7.
Any help or alternative suggestions would be very much appreciated.
Last edited: