Returns the number of working days in a month. Does not take holidays into consideration. I needed this function for the purposes of calculating employee annual salary, and holidays are paid days anyway. Requires my MonthDays and isLeapYear functions.
- Function WorkingDays(someYear, someMonth)
- WorkingDays = 0
- For i = 1 To MonthDays(someYear, someMonth)
- If Weekday(DateSerial(someYear, someMonth, i)) <> 1 And Weekday(DateSerial(someYear, someMonth, i)) <> 7 Then
- WorkingDays = WorkingDays + 1
- End If
- End Function
You need to login to post a comment.