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

Date of last occurrence of weekday in month.

Syntax

Arguments

wkd
Weekday whose date you seek. Enter as an integer from 1 through 7:

Description

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

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 last Monday in June 1997:

To find the last Monday in a week that also contains a Friday in June 1997:

To find the last Monday in May for 1997, 1998, and 1999:

See Also

eomdate, lbusdate, nweekdate



[ Previous | Help Desk | Next ]