• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Sat to Sun Week Range in a month

Hi Guys,

I have another question regarding week range, here is my formula :

=IF($A2<>"",TEXT(IF(WEEKNUM($A2)-WEEKNUM($A2-DAY(A2)+1)+1=1,DATE(YEAR($A2),MONTH($A2),1),A2-MOD($A2-1,7)),"Mmm dd")&"-"&TEXT(IF(WEEKNUM($A2)-WEEKNUM($A2-DAY($A2)+1)+1=ROUNDUP(DAY(DATE(YEAR($A2),MONTH($A2)+1,))/7,0),EOMONTH($A2,0),A2+7-WEEKDAY($A2+2,3)),"dd"),"")

where A is some date.

when date falls on 5 the range it is providing wrong week range


upload_2016-3-17_15-13-41.png
 
Dear James

I think the following formula works.

=IF($A2<>"",TEXT(IF(WEEKNUM($A2)-WEEKNUM($A2-DAY(A2)+1)+1=1,DATE(YEAR($A2),MONTH($A2),1),A2-MOD($A2-1,7)),"Mmm dd")&"-"&TEXT(IF(WEEKNUM($A2)-WEEKNUM($A2-DAY($A2)+1)+1=ROUNDUP(DAY(DATE(YEAR($A2),MONTH($A2)+1,))/7,0),EOMONTH($A2,0),A2+7-WEEKDAY($A2+1,2)),"dd"),"")
 
Hi Jake,

I have tried it, I need Sat and Sun week range, in the file that you gave if date falls in the middle of 2 months it will get the sat of previous month.
Is it possible to have November 29 to Dec 01, since I am looking only at monthly sat to sun week range.
upload_2016-3-17_17-13-45.png
 
@James Carlo Cruz
This my sample uses "dd/mm/yyyy"-format.
If You use "mm/dd/yyyy"-format then
You have to use that format with every date!
Even Excel cannot know is number 12 day or month.
Here, every 12 are months.
Screen Shot 2016-03-17 at 12.46.32.png
 
Back
Top