View Single Post
  #2   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default date of last friday of previous month

On Mon, 14 Nov 2005 09:52:36 -0600, tkaplan
wrote:


I am trying to figure out how to compute the following:

user enters in a date in A1.
B1 needs to calculate the month prior.
C1 needs to calculate the last friday of the month prior to B1.

so if A1 is 11/14/2005,
B1 should be October 2005
C1 should be 9/30/2005

I know how to do B1. I am having a hard time with C1.

Thanks in advance


One problem -- 30 Oct 2005 was a Sunday. Do you want the last Sunday of the
prior month or the last Friday.

B1: =A1-DAY(A1)
Format as: mmmm yyyy

C1: =B1+1-WEEKDAY(B1+2)
will give the last Friday of the month prior to the month in A1

If you want the last Sunday of the month, then:

C1: =B1+1-WEEKDAY(B1)


--ron