Is there a quick way to generate a weekday calendar?

excelos

Well-known Member
Joined
Sep 25, 2011
Messages
592
Office Version
  1. 365
Platform
  1. Windows
Hello!

Is there a quick way to generate a list of the weekday dates between a starting and an ending date? Without weekends?

Thanks!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Here is a Vba solution

Will put dates in Column A of active sheet:

Code:
Sub WeekDays_Only()
'Modified  10/5/2018  9:27:42 PM  EDT
Dim i As Long
Dim aa As Long
Dim x As Long
Dim n As Integer
Dim StartDate As Date
Dim StopDate As Date
On Error GoTo M
StartDate = InputBox("Enter Start Date", "Enter Like this   12/18/2018")
StopDate = InputBox("Enter Stop Date", "Enter Like this   12/18/2018")
n = DateDiff("d", StartDate, StopDate)

    For i = 1 To n
        ans = DateAdd("d", i - 1, StartDate)
        aa = Weekday(ans)
            If aa <> 7 And aa <> 1 Then
            x = x + 1
            Cells(x, 1).Value = ans
            End If
    Next
    
    With Columns(1)
        .NumberFormat = "DDDD,MMMM,DD,YYYY"
        .Font.Size = 16
        .AutoFit
        .HorizontalAlignment = xlLeft
    End With
    Exit Sub
M:
    MsgBox "You enter a improper date"
    End Sub
 
Last edited:
Upvote 0
Hello!

Is there a quick way to generate a list of the weekday dates between a starting and an ending date? Without weekends?

Thanks!
Yes. Here are 3 methods.

Manual
1. Enter the first date & select that cell
2. Home ribbon tab -> Fill (in Editing group) -> Series... -> Columns (or Rows if you want the dates across rather than down) -> Date -> Weekday -> Step value 1 -> Stop value: enter the last date -> OK

Formula
Another fairly easy way is by formula like this, copied down.

Excel Workbook
ABC
1Start27/09/201827/09/2018
2End18/10/201828/09/2018
31/10/2018
42/10/2018
53/10/2018
64/10/2018
75/10/2018
88/10/2018
99/10/2018
1010/10/2018
1111/10/2018
1212/10/2018
1315/10/2018
1416/10/2018
1517/10/2018
1618/10/2018
Weekdays



Macro
For start and end dates in B1:B2 as above & results in column C
Code:
Sub ListWeekdays()
  Dim i As Long
  Dim dStart As Date, dEnd As Date
  
  dStart = Range("B1").Value - 1
  dEnd = Range("B2").Value
  Do
    i = i + 1
    Range("C" & i).Value = WorksheetFunction.WorkDay(dStart, i)
  Loop Until WorksheetFunction.WorkDay(dStart, i + 1) > dEnd
End Sub
 
Last edited:
Upvote 0

Excel 2010
ABC
1StartThu 27-Sep-18Thu 27-Sep-18
2EndThu 18-Oct-18Fri 28-Sep-18
1a
Cell Formulas
RangeFormula
C1=WORKDAY.INTL(B1-1,1,1)
C2=IF((C1+1)<=$B$2,WORKDAY.INTL(C1,1,1),"")


Copy C2 down
 
Last edited:
Upvote 0
Copy C2 down
Dave
Although our formula approaches are quite similar, unless you know just how far to copy your C2 down, it results in a series of error values below the required dates. Hence the check in my formula to return "" if the dates are complete.

Also, if the End Date in B2 happens to be a weekend day, your formula produces a date outside the given date range.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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