WEEKNUM

WEEKNUM(serial_num [,return_type])

Returns the week number in the year for a given date.

serial_numThe date within the week.
return_type(Optional) The number that specifies on what day the week begins:
1 = Sunday (default)
2 = Monday
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)
21 = Monday (1 to 7) European convention

REMARKS
* This function returns a number between 1 and 54.
* If "return_type" is left blank, then 1 is used.
* If "return_type" = 1, the week starts on a Sunday and the weekdays are numbered Sunday = 1 to Saturday = 7.
* If "return_type" = 2, the week starts on a Monday and the weekdays are numbered Monday = 1 to Sunday = 7.
* This function is based on the US convention which defines the week containing January 1st to be the first week of the year.
* The European convention however defines the first week as the first one containing four or more days.
* If "return_type" = 21, then the weekdays according to the European convention are returned.
* If "return_type" = 21, then the first week of the year is the first week that contains at least 4 days (which means it must contain a Thursday).
* You can use the DATE function to return the date serial number given a year, month, day.
* You can use the ISOWEEKNUM function with return_type 21.
* You can use the WEEKDAY function to return the day of the week.
* You can use the WEEKNUMBER - User Defined Function if you want to use a VBA function.
* In Excel 2013 the ISOWEEKNUM function was added to provide a dedicated function to return the week numbers according to the European convention.
* link - learn.microsoft.com/en-us/previous-versions/office/developer/office-2007/bb277364(v=office.12)
* For the Microsoft documentation refer to support.microsoft.com

 A
1=TODAY() = Tuesday, October 01, 2024
2=NOW() = Tuesday, October 01, 2024, 06:08
3=WEEKNUM(A1) = 40
4=WEEKNUM(A2) = 40
5=WEEKNUM("1/10/1999", 1) = 40
6=WEEKNUM("1/10/1999", 2) = 40
7=WEEKNUM("1 Jan 2022", 21) = 52
8=ISOWEEKNUM("1 Jan 2022") = 52
9=WEEKNUM("1/7/1977") = 27
10=WEEKNUM("1/7/1977", 1) = 27
11=WEEKNUM(DATE(7, 2, 2005)) = 31
12=WEEKNUM(TODAY(),30) = #NUM!
13=WEEKNUM(invalid_namedrange) = #NAME?

1 - What is the current system date. This cell has been formatted with the number format "dddd, mmmm dd, yyyy".
2 - What is the current system date and time. This cell has been formatted with the number format "dddd, mmmm dd, yyyy, hh:mm".
3 - What is the week number for the current system date assuming the week starts on a Sunday
4 - What is the week number for the current system date assuming the week starts on a Monday.

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