Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Give this formula a try...
=DATE(B1,A1,22)-WEEKDAY(DATE(B1,A1,7))+7*(DAY(DATE(B1,A1,8)-WEEKDAY(DATE(B1,A1,7)))=1) -- Rick (MVP - Excel) "Bob" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Here is a shorter version...
=DATE(B1,A1,22)-WEEKDAY(DATE(B1,A1,7))+7*(WEEKDAY(DATE(B1,A1,1))=1 ) -- Rick (MVP - Excel) "Rick Rothstein" wrote in message ... Give this formula a try... =DATE(B1,A1,22)-WEEKDAY(DATE(B1,A1,7))+7*(DAY(DATE(B1,A1,8)-WEEKDAY(DATE(B1,A1,7)))=1) -- Rick (MVP - Excel) "Bob" wrote in message ... 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 |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Use Jacob's formula... it is shorter and calls less functions than mine.
-- Rick (MVP - Excel) "Rick Rothstein" wrote in message ... Here is a shorter version... =DATE(B1,A1,22)-WEEKDAY(DATE(B1,A1,7))+7*(WEEKDAY(DATE(B1,A1,1))=1 ) -- Rick (MVP - Excel) "Rick Rothstein" wrote in message ... Give this formula a try... =DATE(B1,A1,22)-WEEKDAY(DATE(B1,A1,7))+7*(DAY(DATE(B1,A1,8)-WEEKDAY(DATE(B1,A1,7)))=1) -- Rick (MVP - Excel) "Bob" wrote in message ... 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 |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=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 |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#9
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Jacob's formula is correct... the OP asked for the Sunday date for the 3rd
FULL weekend... both Saturday and Sunday being within the current month. February 1, 2009 occurs on a Sunday which means its companion Saturday is in the previous month; hence, that first Sunday is not part of a full weekend and is not counted. -- Rick (MVP - Excel) "T. Valko" wrote in message ... =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 |
#10
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Ok, I just re-read the original post. I see now what they meant by full
weekend. -- Biff Microsoft Excel MVP "Jacob Skaria" wrote in message ... 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 |
#11
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Even shorter
=23-WEEKDAY(DATE(B13,A13,1),1) Alan Lloyd |
#12
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I was under the impression the OP wanted the date for the 3rd full Sunday of
the month, not the day number. -- Rick (MVP - Excel) wrote in message ... Even shorter =23-WEEKDAY(DATE(B13,A13,1),1) Alan Lloyd |
#13
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Sep 8, 8:52�am, "Rick Rothstein"
wrote: I was under the impression the OP wanted the date for the 3rd full Sunday of the month, not the day number. OOOPPPSSS - you're quite right <g Mine should be . . . =DATE(B13,A13,23-WEEKDAY(DATE(B13,A13,1),1)) Much the same as Jacob's Alan Lloyd |
#14
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Rick,
Thanks for your help. I really appreciate it. Bob "Rick Rothstein" wrote: Here is a shorter version... =DATE(B1,A1,22)-WEEKDAY(DATE(B1,A1,7))+7*(WEEKDAY(DATE(B1,A1,1))=1 ) -- Rick (MVP - Excel) "Rick Rothstein" wrote in message ... Give this formula a try... =DATE(B1,A1,22)-WEEKDAY(DATE(B1,A1,7))+7*(DAY(DATE(B1,A1,8)-WEEKDAY(DATE(B1,A1,7)))=1) -- Rick (MVP - Excel) "Bob" wrote in message ... 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 |
#15
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Jacob,
Thanks for your elegant and concise formula! Bob "Jacob Skaria" wrote: 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 |
#16
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello,
I suggest =FLOOR(DATE(B1,A1,21),7)+1 Regards, Bernd |
#17
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Mon, 7 Sep 2009 20:24:01 -0700, 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 With some date in the month of interest in A1: =A1-DAY(A1)+23-WEEKDAY(A1-DAY(A1)+1) --ron |
#18
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Mon, 7 Sep 2009 20:24:01 -0700, 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 If you must have the month number in A1 and the year in B1, then: =DATE(B1,A1,23)-WEEKDAY(DATE(B1,A1,1)) --ron |
#19
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Ron,
Thanks for your help. I greatly appreciate it. Bob "Ron Rosenfeld" wrote: On Mon, 7 Sep 2009 20:24:01 -0700, 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 If you must have the month number in A1 and the year in B1, then: =DATE(B1,A1,23)-WEEKDAY(DATE(B1,A1,1)) --ron |
#20
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Wow! What a great formula!
While I understand how the FLOOR function works in general, I can't seem to figure out how it works when used with a date, as in your formula. Thanks for your help. Regards, Bob "Bernd P" wrote: Hello, I suggest =FLOOR(DATE(B1,A1,21),7)+1 Regards, Bernd |
#21
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello Bob,
Dates are just integer numbers in Excel. For a general solution of first (or last) workdays of a given month see http://sulprobil.com/html/weekday_in_month.html please. Regards, Bernd |
#22
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Bernd,
Sorry, I should have been more specific in my comment. While I am aware that dates are just integers, I still do not understand how the FLOOR's "Significance" parameter works when used with dates. Can you elaborate? Thanks, Bob "Bernd P" wrote: Hello Bob, Dates are just integer numbers in Excel. For a general solution of first (or last) workdays of a given month see http://sulprobil.com/html/weekday_in_month.html please. Regards, Bernd |
#23
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello Bob,
FLOOR(x,7) rounds x down to the next number divisible by 7. For non- negative numbers it is the same as x-MOD(x,7). I just use it as a short cut. Regards, Bernd |
#24
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello Barry,
I do not support the 1904 date system. Please see entry #7 of my Excel Don'ts: http://sulprobil.com/html/excel_don_ts.html Regards, Bernd |
#25
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Bernd,
Thanks for the additional info, and for all your help. Regards, Bob "Bernd P" wrote: Hello Bob, FLOOR(x,7) rounds x down to the next number divisible by 7. For non- negative numbers it is the same as x-MOD(x,7). I just use it as a short cut. Regards, Bernd |
#26
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello Bob,
You are welcome. Thanks for your feedback. Regards, Bernd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert WEEKNUM(date;2) to text "Monday 25th - Sunday 31st Oct" | Excel Discussion (Misc queries) | |||
counta & countblank for "month-to-date/year-to-date"? | New Users to Excel | |||
Functions for "current" & "previous" month to calculate data | Excel Worksheet Functions | |||
If date is in the month of Sept, then "1", otherwise "2" | Excel Worksheet Functions | |||
"Disk is Full" add-on question to "Can't reset last cell" post tod | Excel Discussion (Misc queries) |