<-- Previous || Up || Next -->

Number Work Days Function
Dates Times Class

Public Function NumberWorkDays( _
      ByVal vFmDate As Variant _
    , ByVal vToDate As Variant _
    , ParamArray vHolidays() As Variant _
    ) As Variant

Determine the number of business days between two dates, taking into account holidays that fall between the two dates.

Examples:
    NumberWorkDays(#1/1/99#, #3/15/99#) = 52
    NumberWorkDays(#1/1/99#, #3/15/99#, Array(#10/30/98#, #3/1/99#)) = 51
    NumberWorkDays(#3/15/99#, #1/1/99#, Array(#10/30/98#, #3/1/99#)) = -51
See also:
    NumberWorkDaysTest Subroutine
    WorkDays Function
    NETWORKDAYS Function (Microsoft Excel)
Summary: This function considers work days to be the weekdays (Monday through Friday), minus any holidays that occur on a weekday.
vFmDate: The beginning (first day) of the date interval. Function returns Null if vFmDate is Null or cannot be interpreted as a Date. The time component of vFromDate (if any) is ignored.
vToDate: The end (last day) of the date interval. Function returns Null if vToDate is Null or cannot be interpreted as a Date. The time component of vToDate (if any) is ignored.
vHolidays: Optional holidays that are NOT to be considered work days. Can be numbers, one-dimensional numeric arrays, one-dimensional Variant arrays, one-dimensional Variant arrays with embedded arrays, or any combination of these. Any duplicate holidays within vHolidays will be ignored.
Note: This function returns the exact same results as the Microsoft Excel NETWORKDAYS function.
v2.0 Addition: This function is new to this version of Entisoft Tools.

Make sure datFm is before datTo.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.