Partial Weeks

svickers423

New Member
Joined
Aug 23, 2015
Messages
3
I am trying to create a formula or script that will identify partial weeks. The end goal will be to yield if a month ends in the middle of the week I want to have the week start date be the same and the end of week be the last day of the month and the start of the next month be the first day of the week. Weeks start on Sunday and end on Saturday. My dates start in column A2 and go down the row-
In the below the end result would be in the 'Start of week column' would be for 1/27/2019 - the start of week would be 1/27/2019 and EOW would be 1/31/2019 and for 2/1/2019 the start of week would be 2/1/2019 and EOW would be 2/2/2019. All full weeks in the month would hold true to the Sunday date is the start and the EOW would be the Saturday date of that week.

[TABLE="width: 709"]
<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Date[/TD]
[TD]Day Num of Week[/TD]
[TD]Day Date Num[/TD]
[TD]Week[/TD]
[TD]Month[/TD]
[TD]Year[/TD]
[TD]Start of week date[/TD]
[TD]End of week date[/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/27/2019[/TD]
[TD]1[/TD]
[TD]27[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/28/2019[/TD]
[TD]2[/TD]
[TD]28[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/29/2019[/TD]
[TD]3[/TD]
[TD]29[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/30/2019[/TD]
[TD]4[/TD]
[TD]30[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/31/2019[/TD]
[TD]5[/TD]
[TD]31[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2/1/2019[/TD]
[TD]6[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2/2/2019[/TD]
[TD]7[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2/3/2019[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]6[/TD]
[TD]2[/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2/4/2019[/TD]
[TD]2[/TD]
[TD]4[/TD]
[TD]6[/TD]
[TD]2[/TD]
[TD]2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Thanks in advance for any assistance!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Try:

G2 =MAX(DATE(F2,E2,1),DATE(F2,E2,IF(B2=1,C2,C2-B2+1)))
H2 =MIN(EOMONTH(A2,0),DATE(F2,E2,IF(B2=7,C2,C2-B2+7)))

*Don't know if dd/mm/yyyy interferes
 
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,103
Members
452,379
Latest member
IainTru

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