PDA

View Full Version : Problem understanding formula for weekdays.



capterdi
12-08-2006, 11:00 AM
Hi,

I?m having trouble in correlating the numbers on the formulas below with the weekday that is beeing looked for.

This is the formula for getting the 3rd. Thursday of any month of any year:


=IF(OR(WEEKDAY(startdate,1)=6,WEEKDAY(startdate,1)=7),startdate-WEEKDAY(startdate,1)+5+7+14,startdate-WEEKDAY(startdate,1)+5+14)

Note: "startdate" is the range name for cell A1 on worksheet.

This is the one for getting the 2nd. Tuesday of any month of any year:

=IF(OR(WEEKDAY(startdate,1)=1,WEEKDAY(startdate,1)=2),startdate-WEEKDAY(startdate,1)+3+7,startdate-WEEKDAY(startdate,1)+3+7+7)

So, now I?m looking for the formula for the 1st. & 3rd. Monday, but I?m lost.

Any help and advice is appreciated. Thank you.
Capterdi

Shazam
12-08-2006, 11:26 AM
First Monday of the month:

=DATE(YEAR(A2),MONTH(A2),1)-WEEKDAY(DATE(YEAR(A2),MONTH(A2),1)-2)+7


Third Monday of the month:

=DATE(YEAR(A2),MONTH(A2),1)-WEEKDAY(DATE(YEAR(A2),MONTH(A2),1)-2)+21

capterdi
12-08-2006, 12:18 PM
Hi Shazam,

OK...this kind of formula is easier to understand. No problem at all!
Thanks..!!
:hi: