Previous Week and Rolling Average

elephant97

Board Regular
Joined
Sep 18, 2002
Messages
63
Here is my data set:

Date---------FTMR-------Outstanding---Avg Age
5/13/04-----83.70%-----626-------------25.7
5/20/04-----85.60%-----600-------------26.1
5/27/04-----83.30%-----623-------------26.8
6/3/04------85.50%-----647-------------25.1
6/10/04-----85.20%-----664-------------26.9
6/17/04-----85.10%-----660-------------28.3
6/24/04-----85.70%-----611-------------25

I have a query that requests a the user to enter a date and then returns that entire row of information. So, if the user enters 6/24/04, the query will correctly return 85.7, 611, and 25. For my reporting, I only want the user to enter a single date (as noted above). But I need the report to present a few additional elements.

1. I need to also report the previous week. So, if the user enters 6/24/04, I need the data for that week AND the prior week, 6/17/04.

2. I need to report a rolling 13 week average. So, if the user enters 6/24/04, I need the average of each column of data from the user entered date, back 13 weeks. So, the average of columns for 6/24, 6/17, 6/10, 6/3, 5/27, and so on until there are 13 weeks of data.

Thanks for the help!
(y)
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
write some code behind a button to put the date you want to see into a variable then use newvar= dateadd("d", -7, var) to go back 7 days at a time and requery the database
 
Upvote 0

Forum statistics

Threads
1,221,810
Messages
6,162,108
Members
451,743
Latest member
matt3388

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