Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Robert
 
Posts: n/a
Default Leap year indicator

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Leap year indicator

One way

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

assuming the date starts in A1 copy down

--

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


"Robert" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Robert
 
Posts: n/a
Default Leap year indicator


=IF(((YEAR(D2)/4)-(INT(YEAR(D2)/4)))0,1,0)
--
Robert



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Leap year indicator

But that's the opposite to what you posted

21 Mar 2004 = 1
21 Mar 2003 = 0

--

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


"Robert" wrote in message
...

=IF(((YEAR(D2)/4)-(INT(YEAR(D2)/4)))0,1,0)
--
Robert





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Robert
 
Posts: n/a
Default Leap year indicator

Thanks Peo for pointing the mistake. In view of Article ID21436 in MS Help
and Support, I shall adopt yours.
--
Robert





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph
 
Posts: n/a
Default Leap year indicator

"Peo Sjoblom" wrote in message
...

"Robert" wrote in message
...

=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.
--
David Biddulph


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
1900 not a leap year JasonC Excel Worksheet Functions 1 March 30th 06 02:54 AM
How do I get Excel to automatically calculate salaries actually received in financial year? Kei Excel Discussion (Misc queries) 0 March 3rd 06 10:26 AM
Excel leap year question Jason New Users to Excel 4 December 3rd 05 09:01 PM
DOnt calculate leap year kckar Excel Worksheet Functions 8 July 19th 05 02:02 PM
leap year question tiw Excel Discussion (Misc queries) 5 April 20th 05 07:49 PM


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

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

About Us

"It's about Microsoft Excel"