calculating averages based upon past 30 days

smithrd6

Board Regular
Joined
Dec 13, 2005
Messages
150
How to create query to calbculate moving averages over past 30 days. For any given day within past 30 days,the query should indicate the averages for that day.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Two queries. First one will be to determine the date range.
The second one will be based on the first query and will be an aggregate query using the Average function from the Aggregate Options.

Alan
 
Upvote 0
I used this code in my Criteria to pull the dates from the previous week. You'll have to add the rest, but it will by dynamic looking at the current date.

Date()-Weekday(Date())-5 Or Date()-Weekday(Date())-4 Or Date()-Weekday(Date())-3 Or Date()-Weekday(Date())-2 Or Date()-Weekday(Date())-1
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,733
Members
452,939
Latest member
WCrawford

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