Friday Dates

R

rob

I had to resort to a user defined function for this. The
code is not mine, refer to theis web page:

http://www.cpearson.com/excel/datedif.htm

and thanks to Mr. Pearson who wrote the program.

First enter this program into your excel visual basic
editor. If you dont know how, just record a blank macro.
Then go to tools... macro...macros... highlight the macro
you made and click edit. Then cut and past this code
after end sub at the bottom of the window you see on the
right.

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

Now, put this formula in your sheet:

=DAY(NthDayOfWeek(YEAR(A1),(MONTH(A1)),1,6))&", "&DAY
(NthDayOfWeek(YEAR(A1),(MONTH(A1)),2,6))&", "&DAY
(NthDayOfWeek(YEAR(A1),(MONTH(A1)),3,6))&", "&DAY
(NthDayOfWeek(YEAR(A1),(MONTH(A1)),4,6))&", "&DAY
(NthDayOfWeek(YEAR(A1),(MONTH(A1)),5,6))

Note that this formula checks for a date in A1. You can
change that to what you want.

Tough One!
Enjoy!
 

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