View Single Post
 
Old 09-11-2011, 02:45 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Hi,

This article from MS shows how to calculate if a given year is a leap year:
Code:
http://support.microsoft.com/kb/214019
 
=IF(OR(MOD(A1,400)=0,AND(MOD(A1,4)=0,MOD(A1,100)<>0)),"Leap Year", "NOT a Leap Year")
If you are always entering entire fiscal years, then you just need to use this formula to reference the year of the end date. Supposing your start date, 1st July 2011, is in cell A1, and your end date, 30th June 2012 is in cell A2, you would change the formula as follows:
Code:
=IF(OR(MOD(YEAR(A2),400)=0,AND(MOD(YEAR(A2),4)=0,MOD(YEAR(A2),100)<>0)),"Leap Year", "")
If you want to be able to enter any set of dates, which may or may not span multiple years, then it is possible but the formula will become considerably more complicated.
Reply With Quote