• 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.

formula to get the week range of that starts on sunday

Hi,
Here is my question :
I have an excel formula that will compute for the start of the week range (sunday) and end of the week (saturday).
=TEXT($D3-WEEKDAY($D3)+1,"Mmm dd")&"-"&TEXT(IF(MONTH($D3)<>MONTH($D3+6),DATE(YEAR($D3),MONTH($D3)+1,1)-1,$D3+MAX(IF(WEEKDAY($D3+{0,1,2,3,4,5,6})=7,{0,1,2,3,4,5,6},""))),"dd")

D3 = some dates

Need to change Dec 27 - 02 to Jan 01 - 02, would some one please tweak the formula?
Thanks!

upload_2016-3-5_0-29-57.png
 
Hi James ,

Will this work ?

=TEXT(IF(MONTH($D3-WEEKDAY($D3)+1)<>MONTH(D3),$D3,$D3-WEEKDAY($D3)+1),"Mmm dd")&"-"&TEXT(IF(MONTH($D3)<>MONTH($D3+6),DATE(YEAR($D3),MONTH($D3)+1,1)-1,$D3+MAX(IF(WEEKDAY($D3+{0,1,2,3,4,5,6})=7,{0,1,2,3,4,5,6},""))),"dd")

Narayan
 
Hi Narayan,

I am sorry, the formula that I made and you tweak was not fit for my client.
They wanted a report that would always show :

upload_2016-3-5_22-18-15.png

D3 is some dates, in a month they always wanted to divide it to 5 week range
as shown in the column header. No matter what month it should be always in 5 week range

Is there a way that we can do this?
Thanks!

Regards,
JC
 
I cant's tweak your current formula, but hope this works, in D3 is your date, this on E3 and copied down

=TEXT(IF(WEEKNUM(D3)-WEEKNUM(D3-DAY(D3)+1)+1=1,DATE(YEAR(D3),MONTH(D3),1),D3-MOD(D3-1,7)),"Mmm dd")&"-"&TEXT(IF(WEEKNUM(D3)-WEEKNUM(D3-DAY(D3)+1)+1=ROUNDUP(DAY(DATE(YEAR(D3),MONTH(D3)+1,))/7,0),EOMONTH(D3,0),D3+7-WEEKDAY(D3+2,3)),"dd")
 
Back
Top