yearfrac

S

slymeat

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

Myrna Larson

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.
 

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

Similar Threads

Yearfrac error? 3
edate and yearfrac functions not tallying 1
Work's on mine but not others 2
copying_data_using_FillHandle 1
yearfrac format error? 4
SUM Q 2
yearfrac problem 0
Replacing COUNTIFS with COUNTIF 3

Top