Search closest day in the past from today

L

Liquie

From today "Sunday Feb 3rd", I want to know the closest date fo
"Friday" in the past. Nothing like "Sunday"-2="Friday". To be clear,
want the formula to be fixed on "Friday's" as the date progresses, s
tomorrow "Monday Feb 4th", I also want to know the closest date fo
"Friday" in the past

On a further step, I need a 2nd formula for the date of the 2nd "Friday
in the past, ie the Friday before the Friday

Thank you all in advance for the help

Edit: I think I found a solution, but I want to know, if there is a mor
elegant, less messy way to solve this problem

=DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())-3-WEEKDAY(TODAY(),3)
source: http://www.excelbanter.com/showthread.php?t=25905
an
=IF(TEXT(TODAY(),"DDDD")="Monday",-3,IF(TEXT(TODAY(),"DDDD")="Tuesday",-4,IF(TEXT(TODAY(),"DDDD")="Wednesday",-5,IF(TEXT(TODAY(),"DDDD")="Thursday",-6,IF(TEXT(TODAY(),"DDDD")="Friday",0,IF(TEXT(TODAY(),"DDDD")="Saturday",-1,IF(TEXT(TODAY(),"DDDD")="Sunday",-2))))))
[Note: for the Friday before the Friday I would just increase th
subtracted days ie -10,-11,-12,-13,-7,-8 and -9 respectively
combined
=DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())+IF(TEXT(TODAY(),"DDDD")="Monday",-3,IF(TEXT(TODAY(),"DDDD")="Tuesday",-4,IF(TEXT(TODAY(),"DDDD")="Wednesday",-5,IF(TEXT(TODAY(),"DDDD")="Thursday",-4,IF(TEXT(TODAY(),"DDDD")="Friday",0,IF(TEXT(TODAY(),"DDDD")="Saturday",-1,IF(TEXT(TODAY(),"DDDD")="Sunday",-2)))))))-WEEKDAY(TODAY(),3)

I just noticed something and have a question regarding these 4 options

1) =DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())+7-WEEKDAY(TODAY(),3)
2) =DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())+7
3) =TODAY()+CHOOSE(WEEKDAY(TODAY()),1,7,6,5,4,3,2
4) =today()+

They all give the same date, has the guy been made fun of wit
complicated ways of describing a simple thing? And I do not understan
how "-WEEKDAY(TODAY(),3)" doesn't affect the date ie has the sam
outcome as option 2
 
R

Ron Rosenfeld

From today "Sunday Feb 3rd", I want to know the closest date for
"Friday" in the past. Nothing like "Sunday"-2="Friday". To be clear, I
want the formula to be fixed on "Friday's" as the date progresses, so
tomorrow "Monday Feb 4th", I also want to know the closest date for
"Friday" in the past.

With some date in A1, the previous Friday is given by the formula:

=A1-WEEKDAY(A1-6)

On a further step, I need a 2nd formula for the date of the 2nd "Friday"
in the past, ie the Friday before the Friday.

Just subtract 7 from above:

=A1-WEEKDAY(A1-6) -7
 
R

Ron Rosenfeld

With some date in A1, the previous Friday is given by the formula:

=A1-WEEKDAY(A1-6)



Just subtract 7 from above:

=A1-WEEKDAY(A1-6) -7

Or, if you want to reference only today's date, merely substitute TODAY() for A1 in either of the formulas above

e.g: =today()-weekday(today()-6)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top