


This is especially helpful so that in instances where the week is split between two months (e.g. There is a formula that gives the date of the previous Monday. IF(WEEKDAY(DATE(YEAR(B5),MONTH(B5),1)=7, WEEKNUM(DATE(YEAR(B5),MONTH(B5),1)), WEEKNUM(DATE(YEAR(B5),MONTH(B5), 1)) + 1))Īpply the formula for all the rows and it should now display the correct week numbers. This will tell the formula not to add 1 if the 1 st of the month falls on a Saturday (7). So you should tweak the formula to handle this instance by using another IF() statement. However, our cutoff period is a Monday, not a Sunday. This is happening because for the instances where the 1 st of the month falls on a Saturday, the formula counts it as part of the 1 st week. When you inspect the data, you will notice that when the 1 st of the month falls on a weekend, the first weekday of that month starts as week #2 and skips week #1: The week number is now blank when the date falls on a weekend. We can then use an IF() statement to check if the value returned is bigger than 5 (Friday).Īfter integrating the IF() statement, the formula now becomes: Cell C5 = IF(WEEKDAY(B5,2)>5,””, WEEKNUM(B5)-WEEKNUM(DATE(YEAR(B5),MONTH(B5), 1)) + 1) In this case, for simplification, use 2 – Numbers 1 (Monday) through 7 (Sunday), which will return the number 6 and 7 for weekends. return_type – tells what number to return for specific days.īy default it uses 1 – Numbers 1 (Sunday) through 7 (Saturday).

#Google sheets week number serial number
The number 1 is used since we want to find the serial number of the 1 st day of that month so that we can eventually find its corresponding week number. We will be using a combination of the DATE() function to find the serial number of the 1 st of a specific date, and the YEAR() MONTH() functions to find what year and month it should use. Subtract the current week number with the week number of the 1 st of the month and increment it as it goes. Whenever a new month is started, the week counter should reset back to 1.
#Google sheets week number how to
To understand how to fix this, we will go through it step by step. In this example, we want February 1 to be counted as week 1 of February instead of week 5 of January. However, this does not count the 1 st of the month as a new week when it doesn’t fall on a Monday. You will notice that the values rum from week 1 to 53 and then resets to week 1 when it starts a new year. The formula for cell C5 now becomes: Cell C5 = WEEKNUM(B5)ĭrag the formula down to the last row (or double click on the lower right corner of the cell). You will have an option to pick any way of the week. serial_number – this is the date you want to convert.

Its syntax is: = WEEKNUM(serial_number, ) Excel’s WEEKNUM() function is used for Case 1.
