A Time Format Problem

P

PA

I remember reading this on this or another Excel group, and now can not find
it. Please help

Column A and B contain Start and End time.
Column C calculates elapsed time =B2-A2
=B3-A3
etc
The sum total elapsed time at bottom of Column C
What I can not remember is the custom format to use in column C so that if
the end time goes past midnight, it calculates correctly.
Thanks for repeating the answer for me.

Paul
 
P

Pete_UK

The custom format you need is:

[h]:mm:ss

this allows hours above 24 to be displayed, rather than wrapping.

Hope this helps.

Pete
 
P

PA

Thanks, but that is not doing what I need.
I may have not explained correctly,
if start time is 11PM and end time is 2 am it should calculate to 3 hours,
but it is yielding negative (displaying ##########)
 
R

Ron Coderre

Try this formula:

For
A1: (StartTime)
B1: (EndTime)
C1: =MOD(B1-A1,1)
Format C1 as Category: Time, Type: 13:30:55 ( or Custom: h:mm:ss;@)

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
P

PA

Thanks to every one. The problem was the formula
Using =(IF(A2>B2,B2+1-A2,B2-A2)) does the trick with the format [hh]:mm
 

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

Top