Last 15 weeks values

buer4499

New Member
Joined
Jun 15, 2021
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hello,

Is there a formula to pull the last 15 weeks based on the day of the week and the current date.

For example, today is 04/08/2021 and I want to pull the past 15 weeks Mondays.

Data:

Book1
ABCDEFGHIJKLMNOPQRSTUV
1DayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySunday
2Date07/06/202108/06/202109/06/202110/06/202111/06/202112/06/202113/06/202114/06/202115/06/202116/06/202117/06/202118/06/202119/06/202120/06/202121/06/202122/06/202123/06/202124/06/202125/06/202126/06/202127/06/2021
300:00:001.9%1.9%1.9%1.9%1.9%2.1%2.1%1.9%1.9%1.9%1.9%1.9%2.1%2.1%1.9%1.9%1.9%1.9%1.9%2.1%2.1%
401:00:001.6%1.6%1.6%1.6%1.6%1.7%1.7%1.6%1.6%1.6%1.6%1.6%1.7%1.7%1.6%1.6%1.6%1.6%1.6%1.7%1.7%
502:00:001.4%1.4%1.4%1.4%1.4%1.5%1.5%1.4%1.4%1.4%1.4%1.4%1.5%1.5%1.4%1.4%1.4%1.4%1.4%1.5%1.5%
603:00:001.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%
704:00:001.2%1.2%1.2%1.2%1.2%1.3%1.3%1.2%1.2%1.2%1.2%1.2%1.3%1.3%1.2%1.2%1.2%1.2%1.2%1.3%1.3%
805:00:001.4%1.4%1.4%1.4%1.4%1.5%1.5%1.4%1.4%1.4%1.4%1.4%1.5%1.5%1.4%1.4%1.4%1.4%1.4%1.5%1.5%
906:00:002.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%2.2%
1007:00:003.2%3.2%3.2%3.2%3.2%3.4%3.4%3.2%3.2%3.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5.9%6.1%6.1%
2219:00:005.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%
2320:00:005.1%5.1%5.1%5.1%5.1%4.4%4.4%5.1%5.1%5.1%5.1%5.1%4.4%4.4%5.1%5.1%5.1%5.1%5.1%4.4%4.4%
2421:00:004.5%4.5%4.5%4.5%4.5%3.6%3.6%4.5%4.5%4.5%4.5%4.5%3.6%3.6%4.5%4.5%4.5%4.5%4.5%3.6%3.6%
2522:00:003.5%3.5%3.5%3.5%3.5%2.7%2.7%3.5%3.5%3.5%3.5%3.5%2.7%2.7%3.5%3.5%3.5%3.5%3.5%2.7%2.7%
2623:00:002.6%2.6%2.6%2.6%2.6%2.1%2.1%2.6%2.6%2.6%2.6%2.6%2.1%2.1%2.6%2.6%2.6%2.6%2.6%2.1%2.1%
Sheet1
Cell Formulas
RangeFormula
C2:V2C2=B2+1


Layout required:

Book1
ABCDEFGHIJKLMNOPQR
1Today04/08/2021
2
3MondayWeek 15Week 14Week 13Week 12Week 11Week 10Week 9Week 8Week 7Week 6Week 5Week 4Week 3Week 2Week 1
400:00:00
501:00:00
602:00:00
703:00:00
804:00:00
905:00:00
1006:00:00
1107:00:00
1208:00:00
1309:00:00
1410:00:00
1511:00:00
1612:00:00
1713:00:00
1814:00:00
1915:00:00
2016:00:00
2117:00:00
2218:00:00
2319:00:00
2420:00:00
2521:00:00
2622:00:00
2723:00:00
28
Sheet2
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi,

Something like this:

Cell Formulas
RangeFormula
C4:Q27C4=SUMPRODUCT(--(Sheet3!$B$1:$V$1=Sheet4!$B$3),--(WEEKNUM(Sheet3!$B$2:$V$2+0)=WEEKNUM($B$1)+1-RIGHT(C$3,2)),Sheet3!B3:V3)

Notes:
  1. For this formula to work there must always be a space between the word "week" and the actual weeknumber;
  2. Week 1 in the report lay out is assumed to be the current week.
 
Upvote 0
Hey, I used your formula and it's returning a 0% for every value.

15 Week Rolling Dashboard.xlsx
ABCDEFGHIJKLMNOPQ
1Today05/08/2021
2
3Monday19/04/202126/04/202103/05/202110/05/202124/05/202117/05/202131/05/202107/06/202114/06/202121/06/202128/06/202105/07/202112/07/202119/07/202126/07/2021
400:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
501:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
602:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
703:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
804:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
905:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
1006:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
1107:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
1208:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
1309:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
1410:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
1511:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
1612:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
1713:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
1814:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
1915:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
2016:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
2117:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
2218:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
2319:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
2420:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
2521:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
2622:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
2723:00:000.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%0.00%
Sheet2
Cell Formulas
RangeFormula
B1B1=TODAY()
C3C3=$B$1-WEEKDAY($B$1,3)-105
D3D3=$B$1-WEEKDAY($B$1,3)-98
E3E3=$B$1-WEEKDAY($B$1,3)-91
F3F3=$B$1-WEEKDAY($B$1,3)-84
G3G3=$B$1-WEEKDAY($B$1,3)-70
H3H3=$B$1-WEEKDAY($B$1,3)-77
I3I3=$B$1-WEEKDAY($B$1,3)-63
J3J3=$B$1-WEEKDAY($B$1,3)-56
K3K3=$B$1-WEEKDAY($B$1,3)-49
L3L3=$B$1-WEEKDAY($B$1,3)-42
M3M3=$B$1-WEEKDAY($B$1,3)-35
N3N3=$B$1-WEEKDAY($B$1,3)-28
O3O3=$B$1-WEEKDAY($B$1,3)-21
P3P3=$B$1-WEEKDAY($B$1,3)-14
Q3Q3=$B$1-WEEKDAY($B$1,3)-7
C4:Q27C4=SUMPRODUCT(--(Sheet1!$B$1:$V$1=Sheet2!$B$3),--(WEEKNUM(Sheet1!$B$2:$V$2+0)=WEEKNUM($B$1)+1-RIGHT(C$3,2)),Sheet1!B3:V3)
 
Upvote 0
Data:

15 Week Rolling Dashboard.xlsx
ABCDEFGHIJKLMNOPQRSTUV
1DayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySunday
2Date07/06/202108/06/202109/06/202110/06/202111/06/202112/06/202113/06/202114/06/202115/06/202116/06/202117/06/202118/06/202119/06/202120/06/202121/06/202122/06/202123/06/202124/06/202125/06/202126/06/202127/06/2021
300:00:001.9%1.9%1.9%1.9%1.9%2.1%2.1%1.9%1.9%1.9%1.9%1.9%2.1%2.1%1.9%1.9%1.9%1.9%1.9%2.1%2.1%
401:00:001.6%1.6%1.6%1.6%1.6%1.7%1.7%1.6%1.6%1.6%1.6%1.6%1.7%1.7%1.6%1.6%1.6%1.6%1.6%1.7%1.7%
502:00:001.4%1.4%1.4%1.4%1.4%1.5%1.5%1.4%1.4%1.4%1.4%1.4%1.5%1.5%1.4%1.4%1.4%1.4%1.4%1.5%1.5%
603:00:001.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%1.3%
704:00:001.2%1.2%1.2%1.2%1.2%1.3%1.3%1.2%1.2%1.2%1.2%1.2%1.3%1.3%1.2%1.2%1.2%1.2%1.2%1.3%1.3%
805:00:001.4%1.4%1.4%1.4%1.4%1.5%1.5%1.4%1.4%1.4%1.4%1.4%1.5%1.5%1.4%1.4%1.4%1.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%6.3%6.3%6.3%6.3%6.3%6.3%6.3%6.3%6.3%6.3%6.3%6.3%6.3%6.3%6.3%6.3%6.3%
2118:00:005.9%5.9%5.9%5.9%5.9%6.1%6.1%5.9%5.9%5.9%5.9%5.9%6.1%6.1%5.9%5.9%5.9%5.9%5.9%6.1%6.1%
2219:00:005.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%5.4%
2320:00:005.1%5.1%5.1%5.1%5.1%4.4%4.4%5.1%5.1%5.1%5.1%5.1%4.4%4.4%5.1%5.1%5.1%5.1%5.1%4.4%4.4%
2421:00:004.5%4.5%4.5%4.5%4.5%3.6%3.6%4.5%4.5%4.5%4.5%4.5%3.6%3.6%4.5%4.5%4.5%4.5%4.5%3.6%3.6%
2522:00:003.5%3.5%3.5%3.5%3.5%2.7%2.7%3.5%3.5%3.5%3.5%3.5%2.7%2.7%3.5%3.5%3.5%3.5%3.5%2.7%2.7%
2623:00:002.6%2.6%2.6%2.6%2.6%2.1%2.1%2.6%2.6%2.6%2.6%2.6%2.1%2.1%2.6%2.6%2.6%2.6%2.6%2.1%2.1%
Sheet1
Cell Formulas
RangeFormula
C2:V2C2=B2+1
 
Upvote 0
Hi,

Yep, that's correct and caused by the lay out change.
In your initial post line 3 of the summary sheet contained week numbers.

In my notes under my post I explicitly mentioned note 1
Notes:
  1. For this formula to work there must always be a space between the word "week" and the actual weeknumber;
  2. Week 1 in the report lay out is assumed to be the current week.

Change it to this and it should work:
Cell Formulas
RangeFormula
B1B1=TODAY()
C3C3=$B$1-WEEKDAY($B$1,3)-105
D3D3=$B$1-WEEKDAY($B$1,3)-98
E3E3=$B$1-WEEKDAY($B$1,3)-91
F3F3=$B$1-WEEKDAY($B$1,3)-84
G3G3=$B$1-WEEKDAY($B$1,3)-70
H3H3=$B$1-WEEKDAY($B$1,3)-77
I3I3=$B$1-WEEKDAY($B$1,3)-63
J3J3=$B$1-WEEKDAY($B$1,3)-56
K3K3=$B$1-WEEKDAY($B$1,3)-49
L3L3=$B$1-WEEKDAY($B$1,3)-42
M3M3=$B$1-WEEKDAY($B$1,3)-35
N3N3=$B$1-WEEKDAY($B$1,3)-28
O3O3=$B$1-WEEKDAY($B$1,3)-21
P3P3=$B$1-WEEKDAY($B$1,3)-14
Q3Q3=$B$1-WEEKDAY($B$1,3)-7
C4:Q27C4=SUMPRODUCT(--(Sheet1!$B$1:$V$1=Sheet2!$B$3),--(WEEKNUM(Sheet1!$B$2:$V$2+0)=WEEKNUM($B$1)-(18-COLUMN())),Sheet1!$B3:$V3)
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

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