Formula to find last monday (tue, wedn, thu or friday) for a given month

  • Thread starter Thread starter Michele
  • Start date Start date
M

Michele

Hi,
I need a formula to calculate the date of the last monday, tuesday,
wednesday, thursday or friday of a given month.
Can't seem to find the answer anywhere.

example:

day: wednesday (or corresponding nr)
month: 3
year: 2004

Result: 31/03/04


Who can help?

Thank you for reading and eventually answering my question.Back
 
(e-mail address removed) (Michele) wrote in
Hi,
I need a formula to calculate the date of the last monday, tuesday,
wednesday, thursday or friday of a given month.

day: sunday=1, monday=2, etc.

endofmonth:
=EOMONTH(DATE(year,month,1),0)

lastweekday:
=endofmonth-WEEKDAY(endofmonth)+day-7*(WEEKDAY(endofmonth)<day)
 
Back
Top