Auto dates for 2 days

Patcheen

Active Member
Joined
Sep 28, 2015
Messages
391
Office Version
  1. 365
Platform
  1. Windows
Im trying to create a formula to give me dates for only 2 days of the week Tuesday and Friday every week

example -
7.11.23 (Tuesday)

10.11.23 (Friday)

14.11.23 (Tuesday)

17.11.23 (Friday) so on and so on as i only dates for these days
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
How about
Fluff.xlsm
D
101/11/2023
203/11/2023
307/11/2023
410/11/2023
514/11/2023
617/11/2023
721/11/2023
824/11/2023
928/11/2023
10
Data
Cell Formulas
RangeFormula
D2:D9D2=WORKDAY.INTL(D1,SEQUENCE(8),"1011011")
Dynamic array formulas.

Change the 8 to however many dates you want.
 
Upvote 0
Solution
Assume start and end dates in A2 and B2 then with Power Query. Change the values in those cells and click on Refresh All and your output is updated.

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Start", Int64.Type}, {"End", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Tuesday/Friday", each {[Start]..[End]}),
    #"Expanded Tuesday/Friday" = Table.ExpandListColumn(#"Added Custom", "Tuesday/Friday"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Expanded Tuesday/Friday",{{"Tuesday/Friday", type date}}),
    #"Inserted Day of Week" = Table.AddColumn(#"Changed Type1", "Day of Week", each Date.DayOfWeek([#"Tuesday/Friday"]), Int64.Type),
    #"Filtered Rows" = Table.SelectRows(#"Inserted Day of Week", each ([Day of Week] = 2 or [Day of Week] = 5)),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Tuesday/Friday"})
in
    #"Removed Other Columns"
 
Upvote 0
Thank you to you all for your help problem sorted thank you so much
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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