Week Num and using Dynamic Dates

PCRIDE

Well-known Member
Joined
Jan 20, 2008
Messages
902
I have a Week Ending Date Ranges that follow every Sunday.

My report has a box the user enters the Week Ending they want to see, then the report will populate the next 7 week endings to view report.

So if the user enters week ending 3/17/12, the report will populate the next 7 weeks, I simply do a formula =+7, this will add 7 days to the 3/17/12 making the next row 3/24/12. All this works great. However other dependencies on my report rely on a WEEK number, so I point WeekNum to the field where i have =+7, however the weekNumber doesn't work and gives wrong Week Numbers.

I think this is because WeekNUM is pointed to a Date that has the =+7. When I just typed in the same date, the correct WeekNumber populated.

What is a work around? I need the next 7 dates to populate so the report is dynamic.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
So I just re-did the formula and it works now. Maybe this is a bug or corruption :(
 
Upvote 0
WeekNum needs a serial date but doesnt appear to evaluate if the date could be serial just wants a serial date

so WeekNUM((12/03/2012)+7) ignores the date gives you 1 ( 7 days)
WeekNum(A1) okay if A1=12/03/2012
WeekNum(A1) Bad if A1=12/03/2012+7
WeekNum(A1) Good if A1=B1+7 and B1 = 12/03/2012
WeekNum(A1) Good if A1
=DATE(YEAR(B1),MONTH(B1),DAY(B1)+7)
And
=WEEKNUM(DATE(YEAR(B1),MONTH(B1),DAY(B1)+7)) Good
 
Upvote 0
So I had mine configured as your 4th bullet. Once I recreated it, the weekNumber changed to the correct week.

I am not sure what was going on here, the formulas were the same.

Thanks for that info, good to know!!
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
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