WorksheetFunction.Weekday Method

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.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function Weekday ( _
    Arg1 As Object, _
    Arg2 As Object _
) As Double
'Usage
Dim instance As WorksheetFunction
Dim Arg1 As Object
Dim Arg2 As Object
Dim returnValue As Double

returnValue = instance.Weekday(Arg1, Arg2)
double Weekday(
    Object Arg1,
    Object Arg2
)

Parameters

  • Arg1
    Type: System.Object

    Serial_number - a sequential number that represents the date of the day you are trying to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text.

  • Arg2
    Type: System.Object

    Return_type - a number that determines the type of return value.

Return Value

Type: System.Double

Remarks

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)

Microsoft 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. Microsoft Excel for the Macintosh uses a different date system as its default.

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace