Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Third Friday of Month Function

181 views
Skip to first unread message

Joe Bouterse

unread,
Dec 24, 1999, 3:00:00 AM12/24/99
to
I need to be able to calculate the date of the third Friday of the month. I
welcome any ideas and suggestions anyone may have.

Thanks,
Joe

Chip Pearson

unread,
Dec 24, 1999, 3:00:00 AM12/24/99
to
Joe,

I've got tons of date and time relate formulas on the Dates And Times pages
on my web site, starting at www.cpearson.com/excel/datetime.htm . Have a
look around.

Specifically, you might want to use

=DATE(Yr,Mon,1+((Nth-(DoW>=WEEKDAY(DATE(Yr,Mon,1))))*7)+(DoW-WEEKDAY(DATE(Yr
,Mon,1))))

Where Yr is the year, Mon is the month, Nth is the Nth number (e.g., 2 =
second, 3 = third), and DoW is the day of week (1 = Sunday, 2 = Monday,
etc).

If you're looking for VBA code, try

Public Function NthDayOfWeek(Y As Integer, M As Integer, N As Integer, DOW
As Integer) As Date

NthDayOfWeek = DateSerial(Y, M, (8 - WeekDay(DateSerial(Y, M, 1), (DOW + 1)
Mod 8)) + ((N - 1) * 7))

End Function


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting Services
www.cpearson.com ch...@cpearson.com

"Joe Bouterse" <joe...@iquest.net> wrote in message
news:GYR84.4$g3...@news1.iquest.net...

0 new messages