View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default convert time into decimal

When you say (E40-E44)*24 "doesn't work", what do you mean?

Do you get the wrong value? An error? A crash?

If E40 and E44 are both XL times (e.g., time stored as fractional days,
and displayed as hh:mm or hh:mm:ss), then (E40-E44)*24 should work
correctly (make sure you format the result cell as General or a Number
format.

How are you populating E40 and E44? If you're using the NOW() function,
note that it returns the date (as the integer offset from a base date)
as well, so if

E40: =NOW()
E33: 2:00

then your result will be very large.


In article ,
"Richard" <nomailplease.com wrote:

=IF(E44="","X",E40-E44)

the formula above where E40 is the time now, and E44 is the time of 2 hours
ago. I want to return 2 instead of 2:00 PM. How do I do this? I do this
but it does not work (E40-E44)*24.