PC Review


Reply
Thread Tools Rate Thread

Determine date based on day of month (i.e. 2nd Tuesday of the month)

 
 
csb
Guest
Posts: n/a
 
      9th Aug 2006
I've used Excell for years and I'm usually pretty good at finding
answers to my questions. However, this one has eluded me. I figure
the answer is simple and I'll have a "DOH!" moment when it's pointed
out...

I'm trying to determine the date of the 2nd Tuesday of every month in
2007.

Ideally, I'd have two columns. First would have the month, the second
would have the specific date of the 2nd Tuesday for that month.

Can someone kindly point me in the right direction? I can't seem to
figure this one out.

 
Reply With Quote
 
 
 
 
Niek Otten
Guest
Posts: n/a
 
      9th Aug 2006
http://www.cpearson.com/excel/DateTimeWS.htm#NthDoWYear

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"csb" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
| I've used Excell for years and I'm usually pretty good at finding
| answers to my questions. However, this one has eluded me. I figure
| the answer is simple and I'll have a "DOH!" moment when it's pointed
| out...
|
| I'm trying to determine the date of the 2nd Tuesday of every month in
| 2007.
|
| Ideally, I'd have two columns. First would have the month, the second
| would have the specific date of the 2nd Tuesday for that month.
|
| Can someone kindly point me in the right direction? I can't seem to
| figure this one out.
|


 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      9th Aug 2006
=DATE(YEAR(A1),MONTH(A1),1+7*2)-WEEKDAY(DATE(YEAR(A1),MONTH(A1),8-3))

where A1 holds a date

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"csb" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've used Excell for years and I'm usually pretty good at finding
> answers to my questions. However, this one has eluded me. I figure
> the answer is simple and I'll have a "DOH!" moment when it's pointed
> out...
>
> I'm trying to determine the date of the 2nd Tuesday of every month in
> 2007.
>
> Ideally, I'd have two columns. First would have the month, the second
> would have the specific date of the 2nd Tuesday for that month.
>
> Can someone kindly point me in the right direction? I can't seem to
> figure this one out.
>



 
Reply With Quote
 
csb
Guest
Posts: n/a
 
      9th Aug 2006
SOLVED!

Thank you to Niek and Bob for the solutions. Both work great!

I really appreciate your assistance.

 
Reply With Quote
 
Michael Bednarek
Guest
Posts: n/a
 
      9th Aug 2006
On 9 Aug 2006 05:37:09 -0700, "csb" wrote in microsoft.public.excel:

>I've used Excell for years and I'm usually pretty good at finding
>answers to my questions. However, this one has eluded me. I figure
>the answer is simple and I'll have a "DOH!" moment when it's pointed
>out...
>
>I'm trying to determine the date of the 2nd Tuesday of every month in
>2007.
>
>Ideally, I'd have two columns. First would have the month, the second
>would have the specific date of the 2nd Tuesday for that month.
>
>Can someone kindly point me in the right direction? I can't seem to
>figure this one out.


Based on a formula on CP's web site, as pointed out by Niek:
=A1+(WEEKDAY(A1)>=3)*7-WEEKDAY(A1)+3+7
Finds the first Tuesday of a month and adds 7.

This is a function without an implied If:

=DATE(YEAR(A1),MONTH(A1),7*2-6+(MOD(3+7-WEEKDAY(DATE(YEAR(A1),MONTH(A1),1)),7)))

where Tuesday (3) and the second occurrence have been hardwired but are still shown.
It is derived from a 4NT function which computes the Qth occurrence of the weekday N:

: Returns as a date the Q-th occurrence of the weekday N (1-7 = Sun-Sat) for the month of myDate
: E.g.: @nWkDay[3,1,2005-05-01] whill return the date of the 3rd Sunday in May 2005
nWkDay=%@MAKEDATE[%@DATE[%@YEAR[%3]-%@MONTH[%3]-%@EVAL[7 * %1 - 6 + (%2 + 7 - %@DOWI[%@YEAR[%3]-%@MONTH[%3]-1]) %% 7]],4]

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a quick way to determine the first and last biz date of the month Ben Microsoft Excel Programming 3 20th Feb 2009 01:16 PM
Determine the 3rd Tuesday of each month, then perform an action c# Jason Microsoft C# .NET 7 1st Sep 2006 04:57 AM
Using VLookup to Determine Month Based on Regular Date Format TKrepitch@aol.com Microsoft Excel Discussion 4 19th May 2006 06:57 PM
Determine begin month date from month end date. mikeburg Microsoft Excel Programming 3 13th Jan 2006 08:42 PM
Determine the Date Of The Last Day Of Selected Month Melissa Microsoft Access Getting Started 3 4th Oct 2004 12:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:46 PM.