View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid vezerid is offline
external usenet poster
 
Posts: 751
Default If a date range contains a leap year (date)

Start dates in row 1 (starting from B1), End dates in row 2 (starting
from B2). In B3:

=B2-B1DATE(1901+YEAR(B2)-YEAR(B1),MONTH(B2),DAY(B2))-
DATE(1901,MONTH(B1),DAY(B1))

HTH
Kostis Vezerides

On Jul 3, 5:58 pm, Rebecca_SUNY
wrote:
I need to identify whether a date range contains a leap year day - 2/29. I
have a start date and end date and leap year True/False indicator

Start Date 01/01/08 01/01/08 03/31/08 06/30/07

End Date 12/31/08 06/30/08 12/31/08 03/01/08

Leap Year? TRUE TRUE FALSE TRUE

I can say that the range must be (will be) less than or equal to 365/366.

Thanks!