WEEKNUM (week number)

<< Click to Display Table of Contents >>

WEEKNUM (week number)

Syntax:

WEEKNUM(Date [, WeekStartsOn])

Description:

This returns the week number of a Date.

For this purpose, the calculation method commonly used in the USA and many other parts of the world is applied: The first calendar week of the year is always the week that contains January 1st.

According to this method, the first calendar week cannot start in the previous year and does not include a full 7 days in most cases.

Note:

In Germany (and some other countries like Switzerland and Austria), a different method of calculation is normally used; here, it is based on the ISO standard. See ISOWEEKNUM function (or see below WeekStartsOn with value variant "21").

Important:

Also note that by default, this function considers Sunday as the start of the week – not Monday.

However, you can change this with the optional argument WeekStartsOn. WeekStartsOn lets you specify on which day a week starts:

1 or omitted: Week starts on a Sunday.

2: Week starts on a Monday.

In addition, the following variants are also defined:

11: Week starts on a Monday.

12: Week starts on a Tuesday.

13: Week starts on a Wednesday.

14: Week starts on a Thursday.

15: Week starts on a Friday.

16: Week starts on a Saturday.

17: Week starts on a Sunday.

21: Week starts on a Monday. Here, the first calendar week of the year is the week that contains January 4th, in accordance with the ISO standard.

Compatibility notes:

Microsoft Excel supports the values 11-17 and 21 for the argument WeekStartsOn only in version 2010 or later. In older versions, these values are not known.

Example:

On Sunday, January 5, 2020:

WEEKNUM("01/05/2020", 1) returns 2

WEEKNUM("01/05/2020", 2) returns 1

See also:

ISOWEEKNUM, ISOWEEK, YEAR, MONTH, DAY, WEEKDAY