Get the Week number from a date or Week Beginning

sagarwal

New Member
Joined
Feb 3, 2016
Messages
4
As there are 4-5 weeks in a month, so i want to get the Week number ranking from 1 to 5 in that week. There is one condition to it, if there are 5 weeks in a month, then the week number should be considering the Count of Days in that week for that particular month.
For Ex- in Sep'15, there are 5 weeks. 1st week starts with 31st Aug'15, so that should be considered as Week 1 for Sep'15, as there is only one day of Aug falling in that week..Had it been more than 3 days, then it should have been considered as week 5 for Aug'15. For Ex - In WB 28th Sep'15, as there are 3 days falling in that week for Sep'15 (more than 2 days), then I want to be considered as week 5 in Sep'15. This should be the condition with all the weeks in a give year.


I have tried the following formula but not getting the desired result
<code>WEEKNUM(A1,2)-WEEKNUM(DATE(YEAR(A1),MONTH(A1),1),2)+1</code>
<code>Week Beginning Week no.
31-Aug'15 1
7-Sep'15 2
14-Sep'15 3
21-Sep'15 4
28-Sep'15 5
</code>
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi,

You could test : =INT((13+DAY(A1)-WEEKDAY(A1-5))/7)

HTH
 
Upvote 0
James, Thank you for your reply,,Formula which you hve suggested does not solve the purpose..

On 31st May'16, this formula gave me Week no . 5, but I want 31st May to be week 1 for June

This is because the no of days in WB 31st May is less than 3 days....please help..
 
Upvote 0

Forum statistics

Threads
1,216,091
Messages
6,128,772
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top