Products & Services Solutions Academia Support User Community Company

Learn more about Financial Toolbox   

datewrkdy - Date of future or past workday

Syntax

EndDate = datewrkdy(StartDate, NumberWorkDays, NumberHolidays)

Arguments

StartDate

Start date vector. Enter as serial date numbers or date strings.

NumberWorkDays

Vector containing number of work or business days in future (positive) or past (negative), including the starting date.

NumberHolidays

Vector containing values for the number of holidays within NumberWorkDays. NumberHolidays and NumberWorkDays must have the same sign.

Any input can contain multiple values, but if so, all other inputs must contain the same number of values or a single value that applies to all. For example, if StartDate is an n-row character array of date strings, then NumberWorkDays must be an n-by-1 vector of integers or a single integer. EndDate is then an n-by-1 vector of date numbers.

Description

EndDate = datewrkdy(StartDate, NumberWorkDays, NumberHolidays) returns the serial number of the date a given number of workdays before or after the start date.

Use datestr to convert serial date numbers to formatted date strings.

Examples

Workday = datewrkdy('12-dec-2000', 16, 2);
datestr(Workday)
ans =
04-Jan-2001
NumDays = [16; 20; 44];
Workdays = datewrkdy('12-dec-2000', NumDays, 2);
datestr(Workdays)
ans =
4-Jan-2001
10-Jan-2001
13-Feb-2001

See Also

busdate, holidays, isbusday, wrkdydif

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS