View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default How to list dates in a month of particular weekday

Just so you don't think those formulas were mystically arrived at, here is
the generic form for calculating the nth such and such day of a month...

The generic version of the formula is this...

=DATE(Yr,MM,1+7*Nth)-WEEKDAY(DATE(Yr,MM,8-DoW))

where nth is the number you want 1st, 2nd, 3rd etc thus in my first formula
7*1 since you wanted the 1st Friday and where DoW stands for day of the week
with Sunday starting with 1 and so on and where I put 6 for Friday. So, if
you want the 1st Friday of the month number in A1 it would look like

=DATE(YEAR(NOW()),$A$1,1+7*1)-WEEKDAY(DATE(YEAR(NOW()),$A$1,8-6))

which reduces to the first formula I listed.

Note: I don't know if this generic formula was original with him or not, but
I first saw it posted online by Peo Sjoblom.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
You didn't post a lot of detail about your setup. Assuming the month
number is in A1 and your list of Fridays and Saturdays is to be listed in
Column B starting at B1, put these formulas in the indicated cells...

B1: =DATE(YEAR(NOW()),$A$1,8)-WEEKDAY(DATE(YEAR(NOW()),$A$1,2))
B2: =DATE(YEAR(NOW()),$A$1,8)-WEEKDAY(DATE(YEAR(NOW()),$A$1,1))
B3: =IF(B1="","",IF(MONTH(B1+7)=$A$1,B1+7,""))

And then copy down the formula that is in B3 down to B10.

--
Rick (MVP - Excel)


"MasterDragon" wrote in message
...
MY question is simple, sorry if i'm being stupid.

Can anyone tell me how can i make a list which contains only dates of all
the Fridays in a particular month?

In a more advanced sense, can I create a list with all the Fridays AND
Saturdays of a month?