Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / May 2006

Tip: Looking for answers? Try searching our database.

Leap year indicator

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert - 19 May 2006 05:31 GMT
Is there a function to indicate if the YEAR of a given date is a leap year.
eg. 21 Mar 2004 = 1
     21 Mar 2003 = 0
Thank you      
--
Robert
Peo Sjoblom - 19 May 2006 05:38 GMT
One way

=--(DAY(DATE(YEAR(A1),3,0))=29)

assuming the date starts in A1 copy down

Signature

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging."  Lord Healey

> Is there a function to indicate if the YEAR of a given date is a leap
> year.
> eg. 21 Mar 2004 = 1
>      21 Mar 2003 = 0
> Thank you
Robert - 19 May 2006 07:55 GMT
Thanks Peo for pointing the mistake. In view of  Article ID21436 in MS Help
and Support, I shall adopt yours.
Signature

Robert

Robert - 19 May 2006 05:40 GMT
=IF(((YEAR(D2)/4)-(INT(YEAR(D2)/4)))>0,1,0)
Signature

Robert

Peo Sjoblom - 19 May 2006 05:59 GMT
But that's the opposite to what you posted

21 Mar 2004  =  1
21 Mar 2003  =  0

Signature

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging."  Lord Healey

> =IF(((YEAR(D2)/4)-(INT(YEAR(D2)/4)))>0,1,0)
David Biddulph - 19 May 2006 08:43 GMT
>> =IF(((YEAR(D2)/4)-(INT(YEAR(D2)/4)))>0,1,0)

> But that's the opposite to what you posted
>
> 21 Mar 2004  =  1
> 21 Mar 2003  =  0

And even having corrected that, the formula is wrong.  1600 and 2000 were
leap years, but 1700, 1800, and 1900 weren't and 2100 won't be.
Signature

David Biddulph

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.