Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PM PM is offline
external usenet poster
 
Posts: 7
Default Calculating Patch Tuesday

Hi,

I need three formulae that use the current date to give the dates of the
last three 'Patch Tuesdays', i.e. the second Tuesday of the month.
So for today (15th Nov) the relevant dates are 13th Nov, 9th Oct, 11th Sep,
but a week ago the results would have been 9th Oct, 11th Sep, 14th Aug.

Anyone?

TIA
Pete


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Calculating Patch Tuesday

This will return the second Tuesday of the same month as today's date

=DATE(YEAR(TODAY()),MONTH(TODAY()),1)+14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY()),1)+4)


so you can compare to see if today is greater than or equal to the 2nd
Tuesday

=IF(TODAY()=DATE(YEAR(TODAY()),MONTH(TODAY()),1)+ 14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY()),1)+4),DA TE(YEAR(TODAY()),MONTH(TODAY()),1)+14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY()),1)+4),DA TE(YEAR(TODAY()),MONTH(TODAY())-1,1)+14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)+4))


that will give you 11/13/07 for today's date and 10/09/07 if today was one
week ago

so if you put this formula in B1 and you want the previous month's 2nd
Tuesday in B2 then use


=DATE(YEAR(B1),MONTH(B1)-1,1)+14-WEEKDAY(DATE(YEAR(B1),MONTH(B1)-1,1)+4)


copy down the last formula one row and you will get the previous month's 2nd
Tuesday


--


Regards,


Peo Sjoblom


"PM" wrote in message
...
Hi,

I need three formulae that use the current date to give the dates of the
last three 'Patch Tuesdays', i.e. the second Tuesday of the month.
So for today (15th Nov) the relevant dates are 13th Nov, 9th Oct, 11th
Sep,
but a week ago the results would have been 9th Oct, 11th Sep, 14th Aug.

Anyone?

TIA
Pete




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PM PM is offline
external usenet poster
 
Posts: 7
Default Calculating Patch Tuesday

That's perfect Peo, thanks!

"Peo Sjoblom" wrote in message
...
This will return the second Tuesday of the same month as today's date


=DATE(YEAR(TODAY()),MONTH(TODAY()),1)+14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TO
DAY()),1)+4)


so you can compare to see if today is greater than or equal to the 2nd
Tuesday


=IF(TODAY()=DATE(YEAR(TODAY()),MONTH(TODAY()),1)+ 14-WEEKDAY(DATE(YEAR(TODAY
()),MONTH(TODAY()),1)+4),DATE(YEAR(TODAY()),MONTH( TODAY()),1)+14-WEEKDAY(DAT
E(YEAR(TODAY()),MONTH(TODAY()),1)+4),DATE(YEAR(TOD AY()),MONTH(TODAY())-1,1)+
14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)+4))


that will give you 11/13/07 for today's date and 10/09/07 if today was one
week ago

so if you put this formula in B1 and you want the previous month's 2nd
Tuesday in B2 then use


=DATE(YEAR(B1),MONTH(B1)-1,1)+14-WEEKDAY(DATE(YEAR(B1),MONTH(B1)-1,1)+4)


copy down the last formula one row and you will get the previous month's

2nd
Tuesday



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Calculating Patch Tuesday

Thanks for the feedback


--


Regards,


Peo Sjoblom


"PM" wrote in message
...
That's perfect Peo, thanks!

"Peo Sjoblom" wrote in message
...
This will return the second Tuesday of the same month as today's date


=DATE(YEAR(TODAY()),MONTH(TODAY()),1)+14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TO
DAY()),1)+4)


so you can compare to see if today is greater than or equal to the 2nd
Tuesday


=IF(TODAY()=DATE(YEAR(TODAY()),MONTH(TODAY()),1)+ 14-WEEKDAY(DATE(YEAR(TODAY
()),MONTH(TODAY()),1)+4),DATE(YEAR(TODAY()),MONTH( TODAY()),1)+14-WEEKDAY(DAT
E(YEAR(TODAY()),MONTH(TODAY()),1)+4),DATE(YEAR(TOD AY()),MONTH(TODAY())-1,1)+
14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)+4))


that will give you 11/13/07 for today's date and 10/09/07 if today was
one
week ago

so if you put this formula in B1 and you want the previous month's 2nd
Tuesday in B2 then use


=DATE(YEAR(B1),MONTH(B1)-1,1)+14-WEEKDAY(DATE(YEAR(B1),MONTH(B1)-1,1)+4)


copy down the last formula one row and you will get the previous month's

2nd
Tuesday





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 947
Default Calculating Patch Tuesday

This will return the second Tuesday of the same month as today's date
=DATE(YEAR(TODAY()),MONTH(TODAY()),1)+14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY()),1)+4)


Just for a variation, this uses EOMONTH().

=EOMONTH(TODAY(),-1)+MOD(14,WEEKDAY(EOMONTH(TODAY(),-1),2)+6)+8

--
Dana DeLouis


"Peo Sjoblom" wrote in message
...
This will return the second Tuesday of the same month as today's date

=DATE(YEAR(TODAY()),MONTH(TODAY()),1)+14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY()),1)+4)


so you can compare to see if today is greater than or equal to the 2nd
Tuesday

=IF(TODAY()=DATE(YEAR(TODAY()),MONTH(TODAY()),1)+ 14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY()),1)+4),DA TE(YEAR(TODAY()),MONTH(TODAY()),1)+14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY()),1)+4),DA TE(YEAR(TODAY()),MONTH(TODAY())-1,1)+14-WEEKDAY(DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)+4))


that will give you 11/13/07 for today's date and 10/09/07 if today was one
week ago

so if you put this formula in B1 and you want the previous month's 2nd
Tuesday in B2 then use


=DATE(YEAR(B1),MONTH(B1)-1,1)+14-WEEKDAY(DATE(YEAR(B1),MONTH(B1)-1,1)+4)


copy down the last formula one row and you will get the previous month's
2nd Tuesday


--


Regards,


Peo Sjoblom


"PM" wrote in message
...
Hi,

I need three formulae that use the current date to give the dates of the
last three 'Patch Tuesdays', i.e. the second Tuesday of the month.
So for today (15th Nov) the relevant dates are 13th Nov, 9th Oct, 11th
Sep,
but a week ago the results would have been 9th Oct, 11th Sep, 14th Aug.

Anyone?

TIA
Pete






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Calculating Patch Tuesday

On Thu, 15 Nov 2007 15:09:15 -0000, "PM" wrote:

Hi,

I need three formulae that use the current date to give the dates of the
last three 'Patch Tuesdays', i.e. the second Tuesday of the month.
So for today (15th Nov) the relevant dates are 13th Nov, 9th Oct, 11th Sep,
but a week ago the results would have been 9th Oct, 11th Sep, 14th Aug.

Anyone?

TIA
Pete


Here's another way. The hard part is figuring out whether the most recent
"last" Patch Tuesday should be in this month or the previous month. So,
assuming your initial date is in A1:

Most recent "last Patch Tuesday"
B1:

=IF(DAY(A1-DAY(A1)+18-WEEKDAY(A1-DAY(A1)+15))<DAY(A1),
A1-DAY(A1)+18-WEEKDAY(A1-DAY(A1)+15),A1-DAY(A1)+18-WEEKDAY(
A1-DAY(A1)+15)-28-7*((DAY(A1-DAY(A1)+18-WEEKDAY(A1-DAY(A1)+15)-28)14)))

B2: Patch Tuesday previous to that in B1:

=B1-28-7*((DAY(B1-28)14))

Then fill down B2 as far as you need.
--ron
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PM PM is offline
external usenet poster
 
Posts: 7
Default Calculating Patch Tuesday

Three fine solutions. Thanks all for your input.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't open older .xls files after install 2007 patch sfleck Excel Discussion (Misc queries) 0 October 16th 07 07:54 PM
Calculating first/last Monday, Tuesday, etc. in a given month in E Rossta Excel Worksheet Functions 3 May 27th 06 02:19 AM
Latest Office patch de-registered EXCEL 2002 .Word/PP fine. Ideas BBTim Excel Discussion (Misc queries) 2 April 17th 06 09:44 PM
Is there patch or soln?:When I open a shared doc the option for ". MARIAMnSD_CA Excel Discussion (Misc queries) 1 March 26th 05 12:04 AM
Excel fun patch [email protected] Excel Discussion (Misc queries) 0 March 23rd 05 03:20 AM


All times are GMT +1. The time now is 12:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"