View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
dlw dlw is offline
external usenet poster
 
Posts: 510
Default Difference between two dates

sorry, I'm in a snippy mood today
you can use the =round() function for comparisons

"KC" wrote:

as per Excel difference between two dates = 0.0138888888905058
and if i calculate it manually = 1200/(60*60*24) = 0.0138888888888889
both don't match, because of which some of logical conditions are failing.

and that is the reason i need to know how excel is calculating these values.

thanks for your time,
-kc

"dlw" wrote:

both numbers come out to EXACTLY 20 minutes and 0 seconds, which is the
correct answer. What kind of precision are you looking for? Nanoseconds?

"KC" wrote:

consider below data which has two datetime with 20 mins difference
A
1 16-02-10 5:32:34 AM
2 16-02-10 5:52:34 AM
3 0.0138888888905058

where A3 has a formula A2-A1 (as general format), can someone please explain
how this fraction value is derived?

based on my understanding if i convert 20 mins (which is 1200 sec) in terms
of days.
i.e., 1200/(60*60*24) = 0.0138888888888889

which is close to A3 but not exactly same! I need to know a way to exactly
calculate the fraction value that date difference generate.

any help is highly appreciated!
thanks
-kc