WEEKDAY

WEEKDAY(serial_number [,return_type])

Returns the day of the week for a given date.

serial_numberThe date as a serial number.
return_type(Optional) The number that specifies on what day the week starts:
1 = Sunday (1 to 7) (default)
2 = Monday (1 to 7)
3 = Monday (0 to 6)
11 = Monday (1 to 7)
12 = Tuesday (1 to 7)
13 = Wednesday (1 to 7)
14 = Thursday (1 to 7)
15 = Friday (1 to 7)
16 = Saturday (1 to 7)
17 = Sunday (1 to 7)

REMARKS
* This function returns a number between 0 and 7.
* The "serial_number" can be a date value, a serial number or a reference to a cell containing a date.
* The "serial_number" cannot be a text string.
* If "return_type" is left blank, the 1 is used.
* If "return_type" = 1, then Sun = 1, Mon = 2, Tue = 3, Wed = 4, Thu = 5, Fri = 6 and Sat = 7.
* If "return_type" = 2, then Mon = 1, Tue = 2, Wed = 3, Thu = 4, Fri = 5, Sat = 6 and Sun = 7.
* If "return_type" = 3, then Mon = 0, Tue = 1, Wed = 2, Thu = 3, Fri = 4, Sat = 5 and Sun = 6.
* If "return_type" = 11, then Mon = 1, Tue = 2, Wed = 3, Thu = 4, Fri = 5, Sat = 6 and Sun = 7.
* Alternatively you could use a custom number format of "dddd" - Example 9.
* You can use the DATE function to return the date serial number given a year, month, day.
* You can use the ISOWEEKNUM function to return the number of the ISO week of the year for a given date.
* You can use the NOW function to return the serial number of the current system date and time.
* You can use the TEXT function to convert a value to a specified number format.
* You can use the WEEKNUM function to return the week number in the year.
* You can use the WORKDAY.INTL function to return the serial number that is a given number of working days before or after a date.
* The equivalent VBA function is VBA.WEEKDAY
* For the Microsoft documentation refer to support.microsoft.com
* For the Google documentation refer to support.google.com

 AB
1=WEEKDAY(B1) = 601 July 1977 (Friday)
2=WEEKDAY(DATE(1977, 7, 1)) = 602 July 1977 (Saturday)
3=WEEKDAY(B1, 1) = 603 July 1977 (Sunday)
4=WEEKDAY(B1, 2) = 5=NOW() = 01/11/2024
5=WEEKDAY(B1, 3) = 4=NOW() = 45598
6=WEEKDAY(B2, 2) = 6 
7=WEEKDAY(DATE(1977, 7, 2), 2) = 6 
8=WEEKDAY(1/7/1977, 2) = 6 
9=WEEKDAY(NOW(), 2) = 5 
10=WEEKDAY(B4, 2) = 5 
11=WEEKDAY(38093, 2) = 5 
12=TEXT(WEEKDAY(DATE(1977, 7, 1)), "dddd") = Friday 
13=TEXT(WEEKDAY(DATE(2004, 7, 1)), "dddd") = Thursday 
14need to generate #NUM! 

1 - What day was the 1st July 1977. This returns 6 which represents Friday.
2 - What day was the 1st July 1977 when submitted using the DATE function.
3 - What day was the 1st July 1977 when the week starts on a Sunday. This returns 6 which represents Friday.
4 - What day was the 1st July 1977 when the week starts on a Monday (starting at 1). This returns 5 which represents Friday.
5 - What day was the 1st July 1977 when the week starts on a Monday (starting at 0). This returns 4 which represents Friday.

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top