View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default why isn't this formula calculating correctly?

On Sat, 7 Oct 2006 16:50:02 -0700, Dave F
wrote:

Here's the formula:

=IF(I$6<$G14,"",IF($F14<0,"N/A",IF(DATEDIF($G14,I$6,"m")/$B$3*$F14$F14,"",DATEDIF($G14,I$6,"m")/$B$3*$F14)))

I6 is 4/30/2006, G14 is 3/31/2006, F14 is $85,968, B3 is 48

I think it should resolve to 1/48*$85,968 = $1,791. But excel is
calculating it as $0.00.

Thoughts?


Well, the DATEDIF function was only documented in XL2000. I doubt that it is
an officially supported function.

It gives unexpected results, sometimes, if the number of days in the start_date
month is greater than the number of days in the end_date month. For example,
if you use 31 Jan 2006 and 1 Mar 2006, you will discover it is 1 month and -2
days (that's negative 2 days) apart.

The VBA Datediff function does better in those circumstances.
--ron