Work Weeks in Month

kbruner

New Member
Joined
Sep 8, 2008
Messages
16
Hello, Great Excel Minds,

I am searching for a simple solution to display the particular work week of any given month. I have searched through many posts, but I have not seen the solution I need. Thank you for any help you can give.

Given that each work week begins on Monday, and that the work week for a month extends to the end of the week (Sunday) (i.e. the final work week of October 2011 begins on 10/31, so week 5 for October includes the dates 10/31/11 through 11/6/11), the following formula usually gives me the work week for any given date for the month:

=WEEKNUM(A2+1-WEEKDAY(A2,2),2)-WEEKNUM(A2+1-WEEKDAY(A2,2)-DAY(A2+1-WEEKDAY(A2,2))+1,2)

Where it breaks down is if the first day of the month is a Monday (like August of 2011 or October of 2012), where it returns a 0 for the week number. What piece of the puzzle am I overlooking?

Thank you in advance for any help that can be given.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I'm not very good at coming up with elegant date functions, however, the below might work ?

Code:
=ROUNDUP((1+A4-(DATE(YEAR(A4-WEEKDAY(A4,3)),MONTH(A4-WEEKDAY(A4,3)),1+7)-WEEKDAY(DATE(YEAR(A4-WEEKDAY(A4,3)),MONTH(A4-WEEKDAY(A4,3)),7-1))))/7,0)

The above is just calculating days between current date and first Monday of month to which the date in A4 applies - divides by 7 and rounds up result.

I've no doubt about 90% of it is superfluous to those who are good at this type of thing!
 
Upvote 0
I'm not into "elegance", I'm into solutions! :)

Your formula works perfectly through, at least, 2015 for what I need it to do, so it's elegant enough for me.

Thank you so much for your help, DonkeyOte!
 
Upvote 0
That is beautiful, barry! If I were to make one from my head, it would be twice as long as DonkeyOte's! <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
barry, your date formula acumen is EXCELlent!!<o:p></o:p>
 
Upvote 0
That's funny, DonkeyOte!!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
However, your acumen lies elsewhere, DonkeyOte. Like for example the “two-way reverse lookup with dates and time” formula that you helped me with a while back... That formula you gave me was EXCELlent sprinkled with lots of acumen on top!!<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
 
Upvote 0

Forum statistics

Threads
1,213,544
Messages
6,114,239
Members
448,555
Latest member
RobertJones1986

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