ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Calc days between two dates and exclude leap year days (https://www.excelbanter.com/excel-worksheet-functions/167140-calc-days-between-two-dates-exclude-leap-year-days.html)

scoz

Calc days between two dates and exclude leap year days
 
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

Bernard Liengme

Calc days between two dates and exclude leap year days
 
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

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




scoz

Calc days between two dates and exclude leap year days
 
Many thanks Bernard, I'll have a look now

"Bernard Liengme" wrote:

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

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





Ron Rosenfeld

Calc days between two dates and exclude leap year days
 
On Fri, 23 Nov 2007 05:02:18 -0800, scoz
wrote:

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

scoz

Calc days between two dates and exclude leap year days
 
Excellent Ron, Many thanks

"Ron Rosenfeld" wrote:

On Fri, 23 Nov 2007 05:02:18 -0800, scoz
wrote:

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


Ron Rosenfeld

Calc days between two dates and exclude leap year days
 
On Fri, 23 Nov 2007 07:18:00 -0800, scoz
wrote:

Excellent Ron, Many thanks


You're welcome. Glad to help.
--ron


All times are GMT +1. The time now is 11:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com