Financial Toolbox
  Go to function:
    Search    Help Desk 
nweekdate    Examples   See Also

Date of specific occurrence of weekday in month.

Syntax

Arguments

n
Nth occurrence of the weekday in a month. Enter as an integer from 1 through 5.
wkd
Weekday whose date you seek. Enter as an integer from 1 through 7:

Description

d = nweekdate(n, wkd, y, m, g) returns the serial date number for the specific occurrence of the weekday wkd in the given year y and month m, and in a week that also contains the weekday g.

If n is larger than the last occurrence of wkd, d = 0.

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 y is a 1-by-N vector of integers, then m must be a 1-by-N vector of integers or a single integer. d is then a 1-by-N vector of date numbers.

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

Examples

To find the first Thursday in May 1997:

To find the first Thursday in a week that also contains a Wednesday in May 1997:

To find the third Monday in February for 1997, 1998, and 1999:

See Also

fbusdate, lbusdate, lweekdate



[ Previous | Help Desk | Next ]