View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Search closest day in the past from today

On Mon, 04 Feb 2013 06:19:38 -0500, Ron Rosenfeld wrote:

On Sun, 3 Feb 2013 22:17:48 +0000, Liquie wrote:

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


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)