Time format?

B

Bob

I have this formula in Cell G4 formatted [h]:mm:ss which does show the
correct hours
=SUM(C3:C25)*ROUNDUP(Worksheet2!F5/G1,0)
I have this formula in Cell D29
=(G4-INT(G4))*24*C29 which works fine as long as it is under 24 hours
in Cell G4.
How can I get this to work if under or over 24 hours.
Thanks in advance!!
 
J

joeu2004

I have this formula in Cell G4 formatted [h]:mm:ss which
does show the correct hours
=SUM(C3:C25)*ROUNDUP(Worksheet2!F5/G1,0)
I have this formula in Cell D29
=(G4-INT(G4))*24*C29 which works fine as long as it is
under 24 hours in Cell G4.
How can I get this to work if under or over 24 hours.

=G4*24*C29

Excel time is stored as a fraction of a day. So 1 hour is 1/24, 1
minute is 1/1440, and 1 second is 1/86400.

Consequently, 25 hours is 25/24, which is 1 + 1/24.

G4-INT(G4) explicitly removed the integer part, 1 in my example.

That is necessary if G4 contains date as well as time because the
integer part is the date, represented by the number of days since
12/31/1899 (displayed as 1/0/1900).
 

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


Top