NxWeekday - Day of the week for a given date

Returns the day of the week corresponding to a date. The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday), by default.

 

Syntax

NxWeekday(Date, Convention)

Date is the serial date number that represents the given date. If missing, the current date is used.

Convention is a number that designates the weekdays coding (or ordering) scheme. If missing, convention=1 (Sun=1,..,Sat=7) is assumed.

RETURN_TYPE NUMBER RETURNED
1 or omitted Numbers 1 (Sunday) through 7 (Saturday). Behaves like previous versions of Microsoft Excel.
2 Numbers 1 (Monday) through 7 (Sunday).
3 Numbers 0 (Monday) through 6 (Sunday).
11 Numbers 1 (Monday) through 7 (Sunday).
12 Numbers 1 (Tuesday) through 7 (Monday).
13 Numbers 1 (Wednesday) through 7 (Tuesday).
14 Numbers 1 (Thursday) through 7 (Wednesday).
15 Numbers 1 (Friday) through 7 (Thursday).
16 Numbers 1 (Saturday) through 7 (Friday).
17 Numbers 1 (Sunday) through 7 (Saturday).
 

Remarks

  1. NxWeekday performs functionality as the MS Excel built-in function (WEEKDAY), with one important enhancement: it supports and returns array-type arguments.
  2. 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.
  3. If serial_number is out of range for the current date base value, a #NUM! error is returned.
  4. If return_type is out of the range specified in the table above, a #NUM! error is returned.

Examples

  Formula Description (Result)
  =NxWeekday(DATE(2001,12,1),1) 7
  =NxWeekday(DATE(2001,12,1),2) 6
  =NxWeekday(DATE(2001,12,1),3) 5

Files Examples

References

External Links

Have more questions? Submit a request

0 Comments