NxWKNDate - Next or Last Weekend

Returns the serial date number that corresponds to the first (last) day in the next (last) weekend.

 

Syntax

NxWKNDate(date, weekends, holidays, WKND_type, Return_type)

date is the serial date number that represents the date of concern. If missing or omitted, the current date is used.

weekends is the weekend-number or the seven-character code. If missing, Western weekend convention (weekend=1) is assumed.

holidays is an array of holiday dates, holiday codes (e.g. NYD, PRS), a calendar code (e.g. US, GBP, NYMEX) or any combination of them. If missing, the U.S. government calendar is used.

WKND_type is a switch to determine how to handle short or long weekends (1 = all (default), 2 = ignore holidays 3 = only short weekends, 4 = only long weekends).

Method Description
1 all (default): test for long and short weekends
2 ignore holidays; all weekends are short weekends
3 short/regular weekends only
4 long weekends only

Return_type is a switch to select the return output (1 = next weekend (default), 2 = last weekend).

Method Description
1 next weekend (default)
2 last weekend
 

Remarks

  1. See Weekend for a list of supported weekends and their designated numbers/codes.
  2. See Holidays for a list of currently supported holidays.
  3. See Calendars for a list of currently supported calendars.
  4. If the given date falls on a weekend, NxWKNDate adjusts it either forward (next) or backward (last).
  5. The return date corresponds to the first weekend day when return-type = 1 (next).
  6. The return date corresponds to the last weekend day when return-type = 2 (last).
  7. Most functions automatically convert date values to serial numbers.
  8. If start_date is not a valid date, NxWKNDate returns the #VALUE! error value.
  9. If Calendar is not recognized (i.e. not supported), NxWKNDate returns the #VALUE! error value.
  10. Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

Examples

  Formula Description (Result)
  =NxWKNDate(2012-5-27) 41062

Files Examples

References

External Links

Have more questions? Submit a request

0 Comments