Thread: Convert to Hour
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph David Biddulph is offline
external usenet poster
 
Posts: 620
Default Convert to Hour

I don't know what you're trying to do with your formula
=(hour(d4-c4)*60+(d4-c4))
The (d4-c4) term is in Excel time units (number of days), so by adding your
extra term of hour(d4-c4)*60 you are adding 540 days to the time
difference!
If you want the time difference in Excel time units, just use =(d4-c4) and
format as time. If you want it in hours, use =(d4-c4)*24 and format as
number or general.
You can either add the times (and format as [h]:mm to avoid wrapping round
beyond 24 hours), and then multiply by 24 to convert to hours and format as
number or general, or convert to hours when you do the subtraction and add
the results.
--
David Biddulph

"Jimmy" wrote in message
...
This is what I have done so far:
C4 is begin Time: 2/7/07 4:00PM
D4 is endin Time: 2/8/07 1:30AM
E4 is Time Differ: =(hour(d4-c4)*60+(d4-c4))."It shows the different tim.
I35 is Total Time: Then I use Sum to count all the time. It shows 40:30
Which is 40 hours and 30 minutes.
How I can convert it to 40.5 hour or other way I can use it to do some
other
calculation.
Please help!

Thanks!