Get the week number for a given date
=WEEKNUM(serial_num, [return_type])
| Parameter | Description |
|---|---|
serial_num |
A valid Excel date in serial number format. |
return_type |
[optional] The day the week begins. Default is 1. |
The formulas below return the week number for the last day of 2020 and the first day of 2021:
=WEEKNUM("31-Dec-2020") // returns 53
=WEEKNUM("1-Jan-2021") // returns 1
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.
=WEEKNUM("3-Jan-2021") // returns 2
However, when return_type is set to 2, WEEKNUM will return 1 and start week 2 on Monday:
=WEEKNUM("3-Jan-2021",2) // returns 1
=WEEKNUM("4-Jan-2021",2) // returns 2