View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Determining the Sunday date of the third "full" weekend of a m

Biff; the OP is looking for a "full" weekend which the OP has defined as one
in which a Saturday and Sunday occur within the same month..

If this post helps click Yes
---------------
Jacob Skaria


"T. Valko" wrote:

=DATE(B1,A1,22)-WEEKDAY(DATE(B1,A1,1))+1


For Feb 2009 that formula returns 2/22/2009 which is the 4th Sunday of the
month. The 3rd weekday of a month will always be <=21st of the month.

Try this:

=DATE(B1,A1,22)-WEEKDAY(DATE(B1,A1,7))

The general formula for the nth weekday of a month is:

DATE(year,month,1+n*7)-WEEKDAY(DATE(year,month,8-dow))

Whe

n = nth weekday = a number from 1 to 5 (for the 3rd Sunday n = 3)
dow = a number from 1 to 7, Sunday =1 through Saturday = 7

--
Biff
Microsoft Excel MVP


"Jacob Skaria" wrote in message
...
Oops.. correction..
=DATE(B1,A1,22)-WEEKDAY(DATE(B1,A1,1))+1


If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Another one (a bit shorter)

=DATE(B1,A1,22)-WEEKDAY(DATE(YEAR(A1),MONTH(A1),1))+1

If this post helps click Yes
---------------
Jacob Skaria


"Bob" wrote:

For a given month number (in column A) and year (in column B), I need
to
determine the Sunday date of the third "full" weekend. A "full"
weekend is
defined as one in which a Saturday and Sunday occur within the same
month
(i.e., Saturday and Sunday do NOT straddle two months).

For example, the Sunday date of the third "full" weekend in November
2009 is
November 22, whereas the Sunday date of the third "full" weekend in
December
2009 is December 20.

I would greatly appreciate any help in coming up with the formula (and
worksheet function) that will accurately and consistently determine the
Sunday date of the third "full" weekend of a month.

Thanks,
Bob