+ Reply to Thread
Results 1 to 2 of 2

workdays between (excluding holidays)

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    1

    workdays between (excluding holidays)

    I found a short piece of code on the internet to calculate the number of workdays between two dates, and created the following function:


    Function WORKDAYS(StartDate As Date, EndDate As Date) As Variant

    Dim j As Variant
    Do Until StartDate = EndDate
    If Not (Weekday(StartDate) = vbSaturday Or Weekday(StartDate) = vbSunday) Then
    j = j + 1

    End If
    StartDate = StartDate + 1
    Loop
    WORKDAYS = j
    End Function


    I need to amend this code so that it does not count a day, if it is in a list of holidays (which can be stated within the code.)
    I'm aware of the function NetworkdaysIntl, but I need to create this anyway as I have many holiday schedules I need to manipulate.

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: workdays between (excluding holidays)

    Hi,

    how about something like this:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1