NxWKNDate - Next or Last Weekend

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


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

is the serial date number that represents the date of concern. If missing or omitted, the current date is used.
is the weekend number or the seven-character code. If missing, Western weekend convention (weekend=1) is assumed.
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.
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).
Value WKND_type
1 All: test for long and short weekends (default).
2 Ignore holidays; all weekends are short weekends.
3 Short/regular weekends only.
4 Long weekends only.
is a switch to select the return output (1 = Next Weekend (default), 2 = Last Weekend).
Value Return
1 Next weekend (default).
2 Last weekend.


  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 date 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.


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

Files Examples

External Links



Article is closed for comments.

Was this article helpful?
0 out of 0 found this helpful