Second Saturday Of The Month
On Wed, 12 Nov 2008 09:08:03 -0800, FrankM
wrote:
I tried the modification for the Third Monday and it seemed to work fine when
I was delaing with the month of January but when I'm working with February I
seem to have run into a glitch.
I used the following formula ...
=IF(MONTH(A1)=2,A1-DAY(A1)+CHOOSE(WEEKDAY(A1-DAY(A1)),22,21,20,19,18,17,23),"")
A1 is 2/1/2009, the result is 2/23/2009 which is the fourth Monday of the
month (the first Monday is 2/2/2009, followed by 2/9/2009, 2/16/2009 and
2/23/2009).
I could have sworn I had checked and double checked this formula but now
that I'm looking at it again it does not appear to be doing what I thought it
was. If the date is in January it appears to be functioning correctly but I'm
going to double check that now too.
Any ideas?
Frank,
This formula will calculate the first N-day of any month:
=A1-DAY(A1)+8-WEEKDAY(A1-DAY(A1)+8-DOW)
where DOW is 1 for Sunday, 2 for Monday, etc.
So to calculate the third Monday, you would substitute 2 for DOW, and add 14:
=A1-DAY(A1)+8-WEEKDAY(A1-DAY(A1)+8-2)+14
--ron
|