converting 24 hour time to 12 hour time

J

jr0410

Using Excel 2000, when our truck drivers fill in time sheets for when they
deliver loads, they use 24 hour time, such as "1715" (without a colon). I
would like to enter that number in a column and have Excel convert "1715",
for example, into "5:15PM". can this be done without me having to put a
colon in the number (17:15)?
 
B

Bernard Rey

jr0410 :
Using Excel 2000, when our truck drivers fill in time sheets for when they
deliver loads, they use 24 hour time, such as "1715" (without a colon). I
would like to enter that number in a column and have Excel convert "1715",
for example, into "5:15PM". can this be done without me having to put a
colon in the number (17:15)?

One way could be to put this formula in cell B2:

=TIME(LEFT(A2;LEN(A2)-2);(RIGHT(A2;2));0)

This will work if the "1715" number has been entered in cell A2, of course,
and you may have to adapt it to your situation.
 
J

jr0410

Bernard: I receive a formula error message after entering the formula into
the worksheet!
 
J

JE McGimpsey

jr0410 said:
Using Excel 2000, when our truck drivers fill in time sheets for when they
deliver loads, they use 24 hour time, such as "1715" (without a colon). I
would like to enter that number in a column and have Excel convert "1715",
for example, into "5:15PM". can this be done without me having to put a
colon in the number (17:15)?

For a way, using an event macro, to make the change automatic, take a
look here:

http://cpearson.com/excel/DateTimeEntry.htm
 
D

dk_

JE McGimpsey said:
For a way, using an event macro, to make the change automatic, take a
look here:

http://cpearson.com/excel/DateTimeEntry.htm

The code on this link (above) will work perfectly. I am currently doing
exactly the same thing.

This works when entering the times, like "1715". The cell is formatted
in an AM/PM format, and it will display 5:15 PM.

Brilliant trick. :)

-DK
 

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