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

Print last week from a range of Dates

Hello Friends,

I was trying to print last week from a range of dates .But the fornula is partially working.
Need your help on the same.


=IF(MEDIAN(TODAY()-WEEKDAY(TODAY()-2)-7,A2,TODAY()-WEEKDAY(TODAY()-2)-7+5)=A2,"Last Week","")

3rd sep to 9th Sep should print as "Last Week"
10th Sep to 16th Sep as "Blank"


This would continue as the weeks goes on....



Apprecaite your help on the same
 

Attachments

  • lastweek.xlsx
    8.8 KB · Views: 6
Try,

B2, copied down :

=IF(MEDIAN(TODAY()-WEEKDAY(TODAY(),17)-6,A2,TODAY()-WEEKDAY(TODAY(),17))=A2,"Last Week","")

Regards
Bosco
 

Attachments

  • lastweek(1).xlsx
    9.5 KB · Views: 4
You can try a formula like this - it may need a small tweak if your date system is different from mine:
=IF(INT(TODAY()/7)-INT((A2-1)/7)=0,"This week",INT(TODAY()/7)-INT((A2-1)/7) & " week(s) ago")

upload_2017-9-11_11-9-11.png

the -1 week(s) ago is the future!
See attached.

edit post posting:
Actually, I've not given you what you asked for; try in cell B2:
=IF(INT(TODAY()/7)-INT((A2-1)/7)=1,"Last week","")
which only shows last week as 'Last week', everything else is blank.
upload_2017-9-11_11-37-21.png
 

Attachments

  • chandoo35768lastweek.xlsx
    8.8 KB · Views: 5
Last edited:
Back
Top