How to use the WEEKNUM function
What is the WEEKNUM function?
The WEEKNUM function calculates a given date's week number based on a return_type parameter that determines which day the week begins.
What is a week?
A week is a time unit used to represent the cycle of seven days in the Gregorian calendar. A week consists of seven consecutive days, typically beginning on Sunday, Monday or Saturday depending on country and calendar system.
Each week cycles through the seven days of the week - Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday.
How many weeks in a year?
Week numbers range from 1 to 52 for most years. Some years have 53 weeks if the 1st week starts very early in the previous year.
Is a week the same in all parts of the world?
No, the definition and numbering of a week is not the same in all parts of the world.
There are some key differences:
- Start of week - Some calendars start the week on Sunday, others on Monday.
- Week numbering - The rules for when Week 1 begins in a year vary between calendars.
- ISO 8601 standard - This internationally recognizes Monday as start of week and has a consistent week numbering definition.
- Cultural variations - Some cultures or religions use different definitions of a week. For example, the Jewish calendar week starts on Sunday.
What is a week number?
A week number refers to the ordinal numbering of weeks in a calendar year.
ISO 8601 is the international standard for week numbering. Week numbers provide an alternative to the month/day system for identifying dates. They are commonly used in work/school calendars, schedules, timetables, payment periods, etc.
When does week numbers start?
Week 1 is the first week of the year that contains at least 4 days of the new year.
What is the difference between the WEKNUM function and the ISOWEEKNUM function?
ISOWEEKNUM follows the ISO 8601 international standard for week numbering, while WEEKNUM is based on a more localized definition.
ISOWEEKNUM always starts weeks on Monday and Week 1 is the first week with 4+ days in the new year. WEEKNUM can start weeks on Sunday or Monday based on system settings.
Region | First Day of Week | Week Numbering |
---|---|---|
Europe | Monday | ISO 8601 (Week 1 is first with 4+ days in new year) |
North America | Sunday | Other |
South America | Monday | ISO 8601 |
Asia | Monday or Sunday | Varies by country, ISO and others |
Middle East | Saturday | Varies by country |
Africa | Sunday or Monday | ISO 8601 or others |
Most regions follow ISO 8601 now but there are still some variations.
WEEKNUM function Syntax
WEEKNUM(serial_number,[return_type])
WEEKNUM function Arguments
serial_number | Required. A date. If you enter the date in the function then use the DATE function to calculate the correct serial_number. |
[return_type] | Optional. A number determining which day the week begins. If omitted, 1 is used. |
The following table shows how the WEEKNUM function defines a week if [return_type] argument is specified.
[return_type] | Week starts on | System |
1 | Sunday | 1 |
2 | Monday | 1 |
11 | Monday | 1 |
12 | Tuesday | 1 |
13 | Wednesday | 1 |
14 | Thursday | 1 |
15 | Friday | 1 |
16 | Saturday | 1 |
17 | Sunday | 1 |
21 | Monday | 2 |
You also have the option to choose which system to use, see the [return_type] argument.
System 1 | Week 1 is the week that contains January 1. |
System 2 | Week 1 is the week that contains the first Thursday of the year. (European week numbering system). |
WEEKNUM function example
Formula in cell D3:
WEEKNUM function not working
The WEEKNUM function returns #NUM! error if:
- serial_number is out of range.
- [return_type] is out of range.
'WEEKNUM' function examples
The array formula in cell E3 counts unique distinct items for all dates within the same week. Example, week 2 […]
The image above demonstrates a formula in cell E3 that extracts duplicate items if they are on the same date. […]
I have built a sheet to track time at work. It is very simple, there are 13 sheets, one for […]
Functions in 'Date and Time' category
The WEEKNUM function function is one of 22 functions in the 'Date and Time' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form