Calculating first/last Monday, Tuesday, etc. in a given month in E
Try something like this:
For
A1: (a date) eg 03/01/2006
A2: (a day to find) eg TUE
First occurrence of A2 in the month containing A1
C1:
=DATE(YEAR(A1),MONTH(A1),1+7)-WEEKDAY(DATE(YEAR(A1),MONTH(A1),8-MATCH(A2,{"SUN","MON","TUE","WED","THU","FRI","SAT "},0)))
Last occurrence of A2 in the month containing A1
C2:
=DATE(YEAR(A1),MONTH(A1)+1,1+7)-WEEKDAY(DATE(YEAR(A1),MONTH(A1)+1,8-MATCH(A2,{"SUN","MON","TUE","WED","THU","FRI","SAT "},0)))-7
Does that help?
***********
Regards,
Ron
XL2002, WinXP
"Rossta" wrote:
Thanks for the replies to my previous question. I would also like to use
Excel to identify the first and last Monday, Tuesday, etc. of a given month
by date. Thanks.
|