Main Content

wrkdydif

Number of working days between dates

Description

Days = wrkdydif(StartDate,EndDate,Holidays) returns the number of working days between dates StartDate and EndDate inclusive. Holidays is the number of holidays between the given dates, an integer.

example

Examples

collapse all

Determine Days using date character vectors for StartDate and EndDate.

Days = wrkdydif('9/1/2000', '9/11/2000', 1)
Days = 
6

Determine Days using a datetimes for array for StartDate and EndDate.

Days = wrkdydif(datetime(2000,9,1), datetime(2000,9,11), 1)
Days = 
6

Input Arguments

collapse all

Start date, specified as an N-by-1 or 1-by-N vector using a datetime array, string array, or date character vectors.

To support existing code, wrkdydif also accepts serial date numbers as inputs, but they are not recommended.

Data Types: char | string | datetime

End date, specified as an N-by-1 or 1-by-N vector using a datetime array, string array, or date character vectors.

To support existing code, wrkdydif also accepts serial date numbers as inputs, but they are not recommended.

Data Types: char | string | datetime

Number of holidays between the StartDate and EndDate, specified as an N-by-1 or 1-by-N vector of integers.

Data Types: double

Output Arguments

collapse all

Number of working days between dates StartDate and EndDate inclusive, returned an N-by-1 or 1-by-N vector of integers.

Version History

Introduced before R2006a

expand all