Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default # of Days in a Year

Is there a way to tell Excel (in VB or otherwise) to calculate the difference
between 2 dates based solely upon 365 days a year, ignoring whether it is a
leap year or not? I researched various VB/Excel sites and the internet, and
couldn't find an answer to this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default # of Days in a Year

Could you work out a formula or algorithm to do that - I would guess you
could.

Is there a built in function that does it. No.

Are you asking what the algorithm would be? Define what the answer is? You
would the number of days minus any leap days?

--
Regards,
Tom Ogilvy


"Paige" wrote:

Is there a way to tell Excel (in VB or otherwise) to calculate the difference
between 2 dates based solely upon 365 days a year, ignoring whether it is a
leap year or not? I researched various VB/Excel sites and the internet, and
couldn't find an answer to this.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default # of Days in a Year

Don and Tom:
Tried Don's method and unfortunately it doesn't hold true in all scenarios,
but it was an excellent suggestion. Yes, I'm looking for some type of
formula, which I will eventually make into a custom function in VB. I have 2
dates; they could be in the same year or in different years. Date360 and add
5 days for each year is essentially what I'm trying to do; i.e., have a
formula that calculates strictly based upon 365 days a year....not 360 and
not the normal way of calculating which includes leap year consideration.
The formulas I've tried calculate correctly in some scenarios but not in
others; for example, one formula may work if both the start and end dates are
in leap years, but won't if the start date is in a leap year and the end date
is not; sometimes I can't figure out any rhyme or reason to why one formula
works/doesn't work. I tried calculating the number of full years * 365, then
the # of days from 1/1/xx to the start date (ignoring the extra leap day if
applicable), then the # of days from the end date to 12/31/xx (ignoring the
extra leap day if applicable) and adding them all together, but that was
really ugly and I couldn't get it to work either. I just can't seem to get
my brain around this.

"Don Guillett" wrote:

not tested
=DAYS360(E11,E10)+(5*(YEAR(E10)-YEAR(E11)))

--
Don Guillett
SalesAid Software

"Paige" wrote in message
...
Is there a way to tell Excel (in VB or otherwise) to calculate the
difference
between 2 dates based solely upon 365 days a year, ignoring whether it is
a
leap year or not? I researched various VB/Excel sites and the internet,
and
couldn't find an answer to this.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculate days per year 3307 Excel Discussion (Misc queries) 4 April 30th 08 04:31 PM
Calc days between two dates and exclude leap year days scoz Excel Worksheet Functions 5 November 23rd 07 03:58 PM
Year-Days-Months Steve Excel Worksheet Functions 10 September 3rd 06 07:05 AM
i have two days and i want the difference in days, months, year maja Excel Worksheet Functions 7 April 22nd 06 01:14 AM
days in a year gcape Excel Worksheet Functions 1 April 14th 05 06:33 PM


All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"