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

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
 
J

Jonathan Rynd

(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)
 

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