Excel Tutorial
Excel tutorials, quizzes & AI guides — all levels
RSS
  • Online Excel Exercises
  • Training
  • Excel Tests
  • Sitemap
  • Premium Quizzes
  • Shop
  • My account

Week number in Excel: Avoid Mistakes

Date
Reading time: 2 minutes
Views: 4,629

In Excel, there are 2 functions to return the week number from a date.

  1. The WEEKNUM function: This function has existed since the beginning of Excel, but it uses the US method, which can lead to interpretation errors.
  2. The ISOWEEKNUM function: This function has been available since Excel 2013 and returns the week number as determined in Europe.

Different Rules Between the US and Europe

In Europe, week numbers are calculated according to the ISO 8601 standard. This standard specifies that the first week of the year must have at least 4 days.

  • In other words, if the first week of the year starts on a Friday, Saturday, or Sunday, those days are not counted as part of the first week of the year.
  • However, in North America, this rule does not exist. Week numbers are calculated starting on January 1, even if January 1 falls on a Sunday.

Impact in Excel

To understand the impact of these two formulas on week number calculations, let’s analyze this situation.

Calculation with January 1

The following document lists all the January 1 dates from 2018 to 2030.

  • The WEEKNUM function always returns 1 regardless of the first day of the year.
  • With ISOWEEKNUM, if the first day of the year is a Friday, Saturday, or Sunday, the function considers January 1 to belong to the previous year’s week.
Difference between ISOWEEKNUM and WEEKNUM

Week Number with January 4

The following document lists all the January 4 dates from 2018 to 2030.

Not the same week number for some years.

Notes:

  • The week change occurs on a Sunday with the WEEKNUM function.
  • To change the week to a Monday, add 2 as the second parameter in the function =WEEKNUM(date,2).

Week Number in VBA

In VBA, the simplest approach is to use Excel’s calculation functions to return the week number.

Sub Week_Number()
 'Week number in European format
 Cells(1, 1) = Application.WorksheetFunction.IsoWeekNum(Date)
 'Week number in US format
 Cells(1, 1) = Application.WorksheetFunction.WeekNum(Date)
End Sub

Related Articles

  • The WEEKDAY function – Secrets and Errors
  • Add Days Excluding the Weekend in Excel
  • Calculate a date from the week number in Excel
  • How to Calculate the Week Number in Excel?
  • Calculate Monday Previous Week with Excel
  • Calculate the Next Monday with Excel

Frédéric LE GUEN

ISOWEEKNUM, week number, WEEKNUM

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Most Viewed Posts

  • Displaying Negative Numbers in Parentheses in Excel (310,065)
  • Top 10 Excel Functions You Must Know (232,001)
  • How to make automatic calendar in Excel (212,775)
  • Dash for a zero in Excel automatically (190,813)
  • Converting a Date from YYYYMMDD to DD/MM/YYYY in Excel (171,034)
image excel exercises
Excel Exercises
image excel quizzes
Excel Quizzes

Week number in Excel: Avoid Mistakes

Reading time: 2 minutes
Views: 4,629

In Excel, there are 2 functions to return the week number from a date.

  1. The WEEKNUM function: This function has existed since the beginning of Excel, but it uses the US method, which can lead to interpretation errors.
  2. The ISOWEEKNUM function: This function has been available since Excel 2013 and returns the week number as determined in Europe.

Different Rules Between the US and Europe

In Europe, week numbers are calculated according to the ISO 8601 standard. This standard specifies that the first week of the year must have at least 4 days.

  • In other words, if the first week of the year starts on a Friday, Saturday, or Sunday, those days are not counted as part of the first week of the year.
  • However, in North America, this rule does not exist. Week numbers are calculated starting on January 1, even if January 1 falls on a Sunday.

Impact in Excel

To understand the impact of these two formulas on week number calculations, let’s analyze this situation.

Calculation with January 1

The following document lists all the January 1 dates from 2018 to 2030.

  • The WEEKNUM function always returns 1 regardless of the first day of the year.
  • With ISOWEEKNUM, if the first day of the year is a Friday, Saturday, or Sunday, the function considers January 1 to belong to the previous year’s week.
Difference between ISOWEEKNUM and WEEKNUM

Week Number with January 4

The following document lists all the January 4 dates from 2018 to 2030.

Not the same week number for some years.

Notes:

  • The week change occurs on a Sunday with the WEEKNUM function.
  • To change the week to a Monday, add 2 as the second parameter in the function =WEEKNUM(date,2).

Week Number in VBA

In VBA, the simplest approach is to use Excel’s calculation functions to return the week number.

Sub Week_Number()
 'Week number in European format
 Cells(1, 1) = Application.WorksheetFunction.IsoWeekNum(Date)
 'Week number in US format
 Cells(1, 1) = Application.WorksheetFunction.WeekNum(Date)
End Sub

Related Articles

  • The WEEKDAY function – Secrets and Errors
  • Add Days Excluding the Weekend in Excel
  • Calculate a date from the week number in Excel
  • How to Calculate the Week Number in Excel?
  • Calculate Monday Previous Week with Excel
  • Calculate the Next Monday with Excel
Tags: ISOWEEKNUMweek numberWEEKNUM

Frédéric LE GUEN

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net