Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Contains 29 February

Hi All

I need to create a formula which will calculate whether the period between two specified dates contains the 29th February and return "Y" or "N".

Date one is located in cell B164, date two in cell D164 - the first date will always be earlier than the second.

I need to avoid macros as our network securities will not allow them.

Any help would be much appreciated!

Regards,

Amy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Contains 29 February

Hi again,

Am Fri, 17 Apr 2015 12:06:45 +0200 schrieb Claus Busch:

what is the smallest and the largest difference between these dates?
Can you provide some examples?


try it with:
=IF(SUMPRODUCT(--(DAY(ROW(INDIRECT("A"&B164&":A"&D164)))=29),--(MONTH(ROW(INDIRECT("A"&B164&":A"&D164)))=2)),"Y", "N")

If you have 8 0r more years between the dates you can use:
=SUMPRODUCT(--(DAY(ROW(INDIRECT("A"&B164&":A"&D164)))=29),--(MONTH(ROW(INDIRECT("A"&B164&":A"&D164)))=2))
to find how much leap days you have in this period.


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Contains 29 February

Il giorno venerd́ 17 aprile 2015 10:49:02 UTC+2, ha scritto:
I need to create a formula which will calculate whether the period between two specified dates contains the 29th February and return "Y" or "N".
Date one is located in cell B164, date two in cell D164 - the first date will always be earlier than the second.
I need to avoid macros as our network securities will not allow them.
Any help would be much appreciated!


Hi Amy,

=INT(SUM(--(DAY(EOMONTH(ROW(OFFSET(INDIRECT("A"&B164),0,0,D16 4-B164+1,1)),0))=29))/29)
CSE (Array Formula)

--
Ciao! :)
Maurizio
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
replace 29 february with 28 february with vba Herman[_2_] Excel Programming 4 February 18th 11 05:47 PM
I need a february 29th row, but only if the day of year actually exists FatBytestard Excel Worksheet Functions 17 June 9th 09 12:50 PM
Date plus 1 year (february problem) Jessica Excel Worksheet Functions 12 June 28th 06 02:50 PM
When February 29 is date? jj4446 Excel Worksheet Functions 1 January 13th 06 04:11 PM
Function works except with January and February? [email protected] Excel Programming 1 August 12th 04 07:35 AM


All times are GMT +1. The time now is 10:11 PM.

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"