ID EN
#Date and time

WEEKNUM

Excel Functions

Get the week number for a given date

Syntax

EXCEL
=WEEKNUM(serial_num, [return_type])

Arguments

Parameter Description
serial_num A valid Excel date in serial number format.
return_type [optional] The day the week begins. Default is 1.

Return Value

A number between 1 and 54.

Details

The WEEKNUM function takes a date and returns a number between 1 and 54 that corresponds to the week of the year. By default, the WEEKNUM function starts counting on the week that contains January 1 and increments week numbers on Sunday. Typically the last week number in a year is 53. However, WEEKNUM will return 54 at the end of some years, like 2000 and 2028. The WEEKNUM function accepts two arguments, serial_num and return_type. The serial_num argument must have a valid Excel date. The return_type argument controls what day of the week begins a new week number. Return_type is optional and defaults to 1, which sets new week numbers to start on Sunday. When return_type is set to 2, week numbers begin on Monday. With a return_type of 1-17, week number 1 in a given year is assigned to the w

Examples

Example #1 - basic usage

The formulas below return the week number for the last day of 2020 and the first day of 2021:

EXCEL
=WEEKNUM("31-Dec-2020") // returns 53
=WEEKNUM("1-Jan-2021") // returns 1
Example #2 - return type

The return_type argument controls what day of the week a new week number should begin. By default, return_type is 1, and numbers increment on Sunday.

EXCEL
=WEEKNUM("3-Jan-2021") // returns 2
Example #2 - return type

However, when return_type is set to 2, WEEKNUM will return 1 and start week 2 on Monday:

EXCEL
=WEEKNUM("3-Jan-2021",2) // returns 1
=WEEKNUM("4-Jan-2021",2) // returns 2

See Also

ISOWEEKNUM