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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top