median range excel function image

The Excel WEEKNUM function takes a date and returns a week number (1-54) that corresponds to the week of year. The WEEKNUM function starts counting on the week that contains January 1. By default, weeks begin on Sunday, but this can be changed.

Purpose:  Get the week number for a given date  
Return value:  A number between 1 and 54.  
Syntax:  =WEEKNUM (serial_num, [return_type])

Examples:

Basic usage:
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

 
Return type:
The return_type argument controls what day of week begins a new week number.
By default, return_type is 1, and number increments on Sunday.
When return_type is provided as 2, week numbers begin on Monday.
For example, January 3, 2021 is a Sunday and, WEEKNUM will return 2, since new numbers start on Sundays:
=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

There are many more articles on this website, please check the categories or use search box to search any related article.

Related Posts

One thought on “Excel Weeknum function

Leave a Reply