Go Back

Get week number from date

Read time: 20 minutes

In this tutorial, you will learn how to get week number from date. This is possible by using Excel WEEKNUM function. Also, you will get familiar with three different ways to get week number from a date, depending on starting week definition. Based on the selected type of calculating the week number, the function will set the first week of a year.

Get week number from a date

Formula

=WEEKNUM(date, [return_type])

Explanation

The function WEEKNUM returns a week number of a selected date. The parameters of the function are date – a date for which we want to calculate week number in a year; return_type – a non-mandatory parameter, which tells the function how to calculate weeks in a year. The possible values are:

1 – the first week of a year begins on January 1, while the second week begins on the next Sunday;

2 – the first week of a year begins on January 1, while the second week begins on the next Monday;

21 – ISO week numbers: the first week begins on the first Monday between December 29 and January 4.

If this parameter is omitted, the WEEKNUM function will by default set it to 1 when we want to get week number from date.

Example 1

In the example we will see how to get week number from date:

=WEEKNUM(B3)

 

 

Figure 1. Get week number from a date

 

The dates for which we want to calculate week number are in column B (“Date”) and also the week number will be in column C (“Week number”). For the date in B3 (24-Feb-18) the function returned to 8 in cell C3 because the selected date is in the 8th week of the 2018 year.

Also, if we wanted to use return type parameter and define the type of calculating weeks, we could have set it in the function. For example, the function to get week number from a date with ISO weeks would look like:

=WEEKNUM(B3, 21)

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

I would like: If cell E2 has a date then populate B2 with week number using date from E2 If cell E2 is blank - then populate B2 with week number using date from C2 So far I can get the correct week number if E2 has a date, however if E2 is blank I cannot get the correct week number in B2 from C2
Solved by G. H. in 19 mins
I need help finding a formula that will return the Week Number in the year from a date in the form of mm/dd/yyyy.
Solved by S. J. in 14 mins
I need to get the week to date completed in comparison to the goal amount. There are six days in the week and they are written out in the rows not the columns
Solved by F. F. in 26 mins

Leave a Comment

avatar