#1   Report Post  
slymeat
 
Posts: n/a
Default yearfrac

I am using the yearfrac function to calculate the difference between dates

If I use the first date as 31/03/2005 and the 2nd date as 31/03/2009 and use
the yearfrac function, the result is 4.0027397260274

Why is it not 4.00 even?

  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

2008 is a Leap year, so you are getting 1461 days divided by 365 days

"slymeat" wrote:

I am using the yearfrac function to calculate the difference between dates

If I use the first date as 31/03/2005 and the 2nd date as 31/03/2009 and use
the yearfrac function, the result is 4.0027397260274

Why is it not 4.00 even?

  #3   Report Post  
Myrna Larson
 
Posts: n/a
Default

I get that result if I use 3 as the 3rd argument. In that case, the actual
difference in days is used as the numerator, and the denominator is 365. The
only "basis" arguments which yield 4.000 are 0 and 4.

This function is "buggy", especially with arguments of 2 and 3 (or at least it
returns unexpected results). I think the fundamental reason for this is that
it was intended for use with time spans of less than one year, preferably with
both dates in the same calendar year, or, if they span a year-end, neither
year is a leap year.


On Fri, 23 Sep 2005 05:42:04 -0700, "slymeat"
.(donotspam) wrote:

I am using the yearfrac function to calculate the difference between dates

If I use the first date as 31/03/2005 and the 2nd date as 31/03/2009 and use
the yearfrac function, the result is 4.0027397260274

Why is it not 4.00 even?

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
edate and yearfrac functions not tallying slymeat Excel Worksheet Functions 1 September 22nd 05 06:28 PM
Yearfrac problems Adriana Excel Discussion (Misc queries) 1 July 28th 05 11:55 AM
Yearfrac problem Adriana New Users to Excel 1 July 28th 05 10:18 AM
yearfrac problem Adriana Excel Worksheet Functions 0 July 28th 05 08:04 AM


All times are GMT +1. The time now is 08:41 PM.

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"