Week Number for a Saturday to Friday Working Week

curtins4u

New Member
Joined
Jan 21, 2005
Messages
21
Hi,
I've looked at dozens of questions relating to week numbers on this board (and on others) and found nothing that covers what I need. So I'm hopefully not asking a question that's already been answered.

We run reports that need to align to our company's working week that runs from Saturday to Friday.

As many of you will know, Excel's Weeknum function does not allow for a week begining on a Saturday, so I can't use that.

To further complicate things, Week 1 starts on the Saturday <= Jan 1st and week 2 begins on the first Satuday after Jan 1st.
So for 2010 week 1 began on 26/12/2009 and week 2 on 02/01/2010 (dd/mm/yyyy format).
In 2011 week 1 begins on 01/01/2011 and week 2 on 08/01/2011.

I've managed to come up with this formula that works well enough for us to use
"=TRUNC(((A3-DATE(YEAR(A3),1,1))/7))+1+IF(WEEKDAY(DATE(YEAR(A3),1,1))>WEEKDAY(A3),1,0)+IF(WEEKDAY(A3,1)=7,1,0)+IF(WEEKDAY(DATE(YEAR(A3),1,1),1)=7,-1,0)".

It doesn't return the 'correct' week number for the days 26/12/2009 to 31/12/2009, for example, it returns week 53 for these. That's not really a problem for us as we shut down between Christmas and the New Year, so there's nothing to report on.

I've tested it up to 2020 and it does what I need for the weeks that we are actually working.

Now after all that, the question is does anyone know of a better way of achieving what we need?

Ideally it would be nice if it would calculate the correct week number for dates such as 26/12/2009 to 31/12/2009, that we see as week 1 for 2010.

Thank you for any help you can provide.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Try this
=IF(AND(C13="",I13=""),"",IF(weeknumopt="US",WEEKNUM(MAX(C13:I13),$A$6),1+INT((MAX(C13:I13)-DATE(YEAR(MAX(C13:I13)+4-WEEKDAY(MAX(C13:I13)+6)),1,5)+WEEKDAY(DATE(YEAR(MAX(C13:I13)+4-WEEKDAY(MAX(C13:I13)+6)),1,3)))/7)))
 
Upvote 0
Sadi,
thanks for the reply.

What does the formula expect to see in cell A6 and the range C13 to I13?
 
Upvote 0
I've posted formulas before to calculate ISO week numbers. This is similar except start date is Sat instead of Mon and earliest week 1 start is 26th Dec rather than 29th Dec. With date in A3 this should give the correct week number

=INT((A3-WEEKDAY(A3+1)-DATE(YEAR(A3+7-WEEKDAY(A3+1)),1,1))/7)+2
 
Upvote 0

Forum statistics

Threads
1,215,885
Messages
6,127,571
Members
449,385
Latest member
KMGLarson

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