View Single Post
  #3   Report Post  
Harlan Grove
 
Posts: n/a
Default

JE McGimpsey wrote...
Take a look he

http://cpearson.com/excel/DateTimeWS.htm#NthDoW

....

Chip's formulas work, but they're longer than necessary. The 2nd and
4th Wednesdays in the month containing the date given in A3, one could
use

=A3-DAY(A3)+14-WEEKDAY(A3-DAY(A3)+5,3)

and

=A3-DAY(A3)+28-WEEKDAY(A3-DAY(A3)+5,3)

rather than

=A3-DAY(A3)+1+((2-(4=WEEKDAY(A3-DAY(A3)+1)))*7)+(4-WEEKDAY(A3-DAY(A3)+1))

and

=A3-DAY(A3)+1+((4-(4=WEEKDAY(A3-DAY(A3)+1)))*7)+(4-WEEKDAY(A3-DAY(A3)+1))

the latter 2 being the most compact way to render Chip's formulas given
a date in cell A3. The 5 term in the first 2 formulas corresponds to
Wednesday by counting back from Sunday = 1, so Saturday = 2, etc.