The Excel Weekday function returns an integer representing the day of the week for a supplied date.
The syntax of the function is:
Where the function arguments are as follows:
|serial_number||-||The Excel date that you want to return the weekday of.|
|[return_type]||-||An optional integer argument that specifies which integers are to be assigned to each weekday. Possible values are:|
If omitted, the [return_type] argument is set to the default value 1 (i.e. Sunday = 1, Monday = 2, ... , Saturday = 7).
Note: only options 1, 2 & 3 above are available in Excel 2007 and earlier.
Note that it is advised that you do not type dates directly into functions, as Excel may interpret text representations of dates differently, depending on the date settings on your computer. Therefore the serial_number argument for the Weekday function should be input as either:
Column A of the spreadsheet below stores the dates of a series of events. The Weekday function, in column B of the spreadsheet, shows the weekday of each date in column A.
The above data can now be used in an Excel Pivot Table, to show the number of events occurring on each weekday. A pivot table made from the sample of data above is shown on the rightabove.
If you use the Weekday function with the [return_type] argument set to 1, then you can use Excel formatting to display the weekday names instead of showing numbers.
To format the weekday to show the weekday name:
Note, this only works if the [return_type] is set to 1.
For further information and examples of the Excel Weekday function, see the Microsoft Office website.
If you get an error from the Excel Weekday function, this is likely to be one of the following:
Occurs if either:
|#VALUE!||-||Occurs if either the supplied serial_number or the supplied [return_type] is non-numeric.|