# Calc days between two dates and exclude leap year days

S

#### scoz

Hi
I need to calculate number of days between two dates, over a period of yrs
and discount the extra day in a leap year!!!!
Any ideas anyone?

Many thanks in advance

B

#### Bernard Liengme

Visit www.cpearson.com and see what Chip does with the undocumented DATEDIF
function. Not sure if he 'discounts' leap year.
best wishes

S

#### scoz

Many thanks Bernard, I'll have a look now

Bernard Liengme said:
Visit www.cpearson.com and see what Chip does with the undocumented DATEDIF
function. Not sure if he 'discounts' leap year.
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

R

#### Ron Rosenfeld

Hi
I need to calculate number of days between two dates, over a period of yrs
and discount the extra day in a leap year!!!!
Any ideas anyone?

Many thanks in advance

=A2-A1-SUMPRODUCT((MONTH(ROW(
INDIRECT(A1&":"&A2)))=2)*(DAY(ROW(
INDIRECT(A1&":"&A2)))=29))

where

A1: Start Date
A2: End Date
--ron

S

#### scoz

Excellent Ron, Many thanks

Ron Rosenfeld said:
=A2-A1-SUMPRODUCT((MONTH(ROW(
INDIRECT(A1&":"&A2)))=2)*(DAY(ROW(
INDIRECT(A1&":"&A2)))=29))

where

A1: Start Date
A2: End Date
--ron

R

#### annei

Hi Ron - 12 years later this is exactly what I needed. Thank you!