Want to create a list of weekends excluding 3rd and 5th Saturday of every month

James Clear

Board Regular
Joined
Jul 12, 2021
Messages
139
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2010
Platform
  1. Windows
Let us say I have 01- 01-2022 mentioned in A1

Now I want to create a list downside from A2 all dates of following saturdays n sundays excluding 3rd n 5th Saturday

Like
01- 01-2022
02-01-2022
08-01-2022
09-01-2022
16-01-2022
22-01-2022
23-01-2022
30-01-2022
05-02-2022
06-02-2022
12-02-2022
13-02-2022
20-02-2022

And so on

Please help me to build this formula
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Late too, but is it the shortest one?
Code:
=WORKDAY.INTL(A1,1+OR(A1+4=A1-DAY(A1+1)+CHOOSE(WEEKDAY(A1-DAY(A1+1)+2),6,5,4,3,2,1,0)+{14,28}),"1111100")
@ bebo021999: Yes, your formula is the shortest one yet, but, with a starting date of 1-Jan-2022, it begins to stumble in March 2022 -- it misses the first Saturday of March (5-Mar-2022), then it misses the first Saturday of April (2-Apr-2022), first Saturday of June (4-Jun-2022), etc... :(
 
Upvote 0
it misses the first Saturday of March (5-Mar-2022), then it misses the first Saturday of April (2-Apr-2022), first Saturday of June (4-Jun-2022), etc...
Not only that, but it replaces the missing dates with the following Sunday.

@James Clear as bebo021999's formula does not work I have unmarked it as the solution. I would suggest that you mark one of the other suggestion as the solution.
 
Upvote 0
Try again:
Code:
=WORKDAY.INTL(A1,1+OR(A1=A1-DAY(A1+6)+1+CHOOSE(WEEKDAY(A1-DAY(A1+6)+7),6,5,4,3,2,1,0)+{14,28}),"1111100")
 
Upvote 0
Try again:
Code:
=WORKDAY.INTL(A1,1+OR(A1=A1-DAY(A1+6)+1+CHOOSE(WEEKDAY(A1-DAY(A1+6)+7),6,5,4,3,2,1,0)+{14,28}),"1111100")
I am still trying to figure out your logic

OR(A1=A1-DAY(A1+6)+1+CHOOSE(WEEKDAY(A1-DAY(A1+6)+7),6,5,4,3,2,1,0) = This gives every time 1 then what's purpose and why Or statement in between along with Plus sign?

Why {14,28} ?? what's purpose?

Please make me understand stepwise...i am getting confused but at the same time I would want to understand each basic step
 
Upvote 0
Not only that, but it replaces the missing dates with the following Sunday.

@James Clear as bebo021999's formula does not work I have unmarked it as the solution. I would suggest that you mark one of the other suggestion as the solution.
@ Flupp

I derived my solution on my own

When K2 = 1-Jul-2022

=IF(OR(AND(TEXT(WORKDAY.INTL(K2,1,"1111100"),"ddd")="Sat",ROUNDUP(DAY(WORKDAY.INTL(K2,1,"1111100"))/7,0)=3),((AND(TEXT(WORKDAY.INTL(K2,1,"1111100"),"ddd")="Sat",ROUNDUP(DAY(WORKDAY.INTL(K2,1,"1111100"))/7,0)=5)))),WORKDAY.INTL(K2,1,"1111110"),WORKDAY.INTL(K2,1,"1111100"))
 
Upvote 0
Solution
OR(A1=A1-DAY(A1+6)+1+CHOOSE(WEEKDAY(A1-DAY(A1+6)+7),6,5,4,3,2,1,0) = This gives every time 1 then what's purpose and why Or statement in between along with Plus sign?
Why {14,28} ?? what's purpose?
Please make me understand stepwise...i am getting confused but at the same time I would want to understand each basic step
All I tried is to find 1st Saturday in month, then +14 or 28 to get the 3rd and 5th Sat of that month
In which:
1st Sat =CHOOSE(WEEKDAY(A1+6-DAY(A1+6)+1),6,5,4,3,2,1,0)
then 3rd or 5th Sat:
=CHOOSE(WEEKDAY(A1+6-DAY(A1+6)+1),6,5,4,3,2,1,0)+{14,28})

Then if date fall into 3rd or 5th Sat, then +1, else +0
=1+OR(A1+1=A1+1-DAY(A1+6)+1+CHOOSE(WEEKDAY(A1-DAY(A1+6)+7),6,5,4,3,2,1,0)+{14,28})
=1+OR(A1+6=A1+6-DAY(A1+6)+1+CHOOSE(WEEKDAY(A1-DAY(A1+6)+7),6,5,4,3,2,1,0)+{14,28})
=1 (or 2)

General formula:
=WORKDAY.INTL(A1,1 (or 2) ,"1111100")
in which:
=WORKDAY.INTL(A1,1 ,"1111100"): if A1 fall into NOT 3rd and 5th Sat
=WORKDAY.INTL(A1,2 ,"1111100"): if A1 fall into 3rd and 5th Sat

Hope it is clear for you now.
 
Upvote 0
All I tried is to find 1st Saturday in month, then +14 or 28 to get the 3rd and 5th Sat of that month
In which:
1st Sat =CHOOSE(WEEKDAY(A1+6-DAY(A1+6)+1),6,5,4,3,2,1,0)
then 3rd or 5th Sat:
=CHOOSE(WEEKDAY(A1+6-DAY(A1+6)+1),6,5,4,3,2,1,0)+{14,28})

Then if date fall into 3rd or 5th Sat, then +1, else +0
=1+OR(A1+1=A1+1-DAY(A1+6)+1+CHOOSE(WEEKDAY(A1-DAY(A1+6)+7),6,5,4,3,2,1,0)+{14,28})
=1+OR(A1+6=A1+6-DAY(A1+6)+1+CHOOSE(WEEKDAY(A1-DAY(A1+6)+7),6,5,4,3,2,1,0)+{14,28})
=1 (or 2)

General formula:
=WORKDAY.INTL(A1,1 (or 2) ,"1111100")
in which:
=WORKDAY.INTL(A1,1 ,"1111100"): if A1 fall into NOT 3rd and 5th Sat
=WORKDAY.INTL(A1,2 ,"1111100"): if A1 fall into 3rd and 5th Sat

Hope it is clear for you now.
Shall practice at my end stepwise n understand.
Thank You for your assistance.
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,598
Members
449,089
Latest member
Motoracer88

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