Time formats

C

Carla

Hello,
Using Excel 2003, I am trying to convert 24 hour times (currently formatted
as general) into h:mm AM/PM. My ultimate goal is calculate the difference
between times, which sometimes straddles two 24 hour periods. See example
data and current formatting below.
Hope someone can help.
Thanks,
--
Carla

Arrival time Departure time Difference
2335 0250
1340
0200
1400
0240
1355
0130
1300
0220
1435
0245
0730
 
P

Pete_UK

You can convert those values into Excel times using this:

=TIME(LEFT(A2,2),RIGHT(A2,2),0)

then apply Format | Cells to the cell to set it up to display as h:mm
AM/PM.

If you don't want to use a helper column, then you can do this:

=TIME(LEFT(B2,2),RIGHT(B2,2),0) -TIME(LEFT(A2,2),RIGHT(A2,2),0) +
(B2<A2)

in C2 - again, format this cell as you require (maybe just h:mm)

Hope this helps.

Pete
 
C

Carla

Thank you Bob for taking the time to help me out. I couldn't get this
formula working, but appreciate the assistance.
 
B

Bob Phillips

It worked fine for me in the example that you provided, 2335 and 250. It
assumes both are text cells, but so does Pete's for your example and you say
that worked so that should not be the issue.
 

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