Get start and end date for week (challenging)

rpaulson

Well-known Member
Joined
Oct 4, 2007
Messages
1,376
Hello all,

not as easy as it sounds

we use weeks that start on Monday as the first day of the week. therefore in our WEEKNUM formula we use type 21. example =WEEKNUM (A1, 21).

there are times wen the week number will wrap thru a year change.

I'm looking for a formula or VBA option to get the start and end of the week if I supply the year and the week. (See sample).

A1=2022
A2=13

should fetch March 28, 2022 and April 3 2022

-Ross
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
How about
+Fluff 1.xlsm
ABC
1202228/03/202203/04/2022
213
Main
Cell Formulas
RangeFormula
B1B1=WORKDAY.INTL(DATE(A1,1,A2*7),-1,"0111111")
C1C1=WORKDAY.INTL(B1,1,"1111110")
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
throws an "Argument not optional" error in in my VBA

VBA Code:
Range("Z1") = WorksheetFunction.WorkDay.INTL(WorksheetFunction.Date(2022, 1, 13 * 7), -1, "0111111")

ideas?
 
Upvote 0
Change the . in the function name to an underscore.
 
Upvote 0
no luck.
VBA Code:
Range("Z1") = WorksheetFunction.WorkDay_Intl(WorksheetFunction.Date(2022, 1, 13 * 7), -1, "0111111")
 
Upvote 0
Use the vba dateserial instead
VBA Code:
Range("Z1") = WorksheetFunction.WorkDay_Intl(DateSerial(2022, 1, 13 * 7), -1, "0111111")
 
Upvote 0
Solution
works, thanks again,

on a side note: to return the end date could I just not use B1+6 instead of WORKDAY.INTL(B1,1,"1111110")
 
Upvote 0

Forum statistics

Threads
1,214,913
Messages
6,122,207
Members
449,074
Latest member
cancansova

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