#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Time Cells

I have a data dump that depicts 7:00 am as "700" and 5:00 pm as "500" (both
numbers.) I need to convert them to military time. Is there an easy way to
do this? When I try formatting the cells as time they all change to "00:00"
as excel attemps to convert the number into a date & time. Any guidance is
appreciated.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Time Cells

put 2400 in an empty cell.
Edit|copy that cell
select the range to fix
edit|paste special|divide

Format those selected cells the way you want -- HH:MM (maybe).

Clean up that cell with 2400 in it.



PopTracker wrote:

I have a data dump that depicts 7:00 am as "700" and 5:00 pm as "500" (both
numbers.) I need to convert them to military time. Is there an easy way to
do this? When I try formatting the cells as time they all change to "00:00"
as excel attemps to convert the number into a date & time. Any guidance is
appreciated.

Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 95
Default Time Cells

Poptracker,

The 700 and 500 are indeed translated into dates, to be exact the day 700
days after 1/1/1900 and 500 days after 1/1/900, as excell sees 1 in date/time
format as a day.
To translate to time, if you only have full hours, devide by 2400 and then
format as time

If you have minutes as well as hours (ie 530 is 5:30), it is a bit more
complicated as you first have to split the hours and the minutes. For
example, use Right(A1,2) to get the minutes (30 in this case), deduct the
minutes from the original number to get the hours (500 in this case). Devide
the hours by 2400 (normally 24, but your hours are still notes as 100's),
devide the minutes by (60*24) and add them up; format as time, done

rdwj



"PopTracker" wrote:

I have a data dump that depicts 7:00 am as "700" and 5:00 pm as "500" (both
numbers.) I need to convert them to military time. Is there an easy way to
do this? When I try formatting the cells as time they all change to "00:00"
as excel attemps to convert the number into a date & time. Any guidance is
appreciated.

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 95
Default Time Cells

or in one formula
=(F7-RIGHT(F7,2))/2400+RIGHT(F7,2)/(60*24)
with the time in cell F7

"PopTracker" wrote:

I have a data dump that depicts 7:00 am as "700" and 5:00 pm as "500" (both
numbers.) I need to convert them to military time. Is there an easy way to
do this? When I try formatting the cells as time they all change to "00:00"
as excel attemps to convert the number into a date & time. Any guidance is
appreciated.

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Time Cells

rdwj's comment about 730 returning 7:30 breaks my suggestion.

But another formula:

=--(TEXT(A1,"00\:00"))

and format the result as hh:mm

Dave Peterson wrote:

put 2400 in an empty cell.
Edit|copy that cell
select the range to fix
edit|paste special|divide

Format those selected cells the way you want -- HH:MM (maybe).

Clean up that cell with 2400 in it.

PopTracker wrote:

I have a data dump that depicts 7:00 am as "700" and 5:00 pm as "500" (both
numbers.) I need to convert them to military time. Is there an easy way to
do this? When I try formatting the cells as time they all change to "00:00"
as excel attemps to convert the number into a date & time. Any guidance is
appreciated.

Thanks


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Time Cells

So how does your data dump distinguish between 6am and 6pm?
--
David Biddulph

"PopTracker" wrote in message
...
I have a data dump that depicts 7:00 am as "700" and 5:00 pm as "500" (both
numbers.) I need to convert them to military time. Is there an easy way
to
do this? When I try formatting the cells as time they all change to
"00:00"
as excel attemps to convert the number into a date & time. Any guidance
is
appreciated.

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formatting cells for time Terrie Excel Discussion (Misc queries) 1 July 25th 07 07:44 AM
formatting cells for time Terrie Excel Discussion (Misc queries) 1 July 24th 07 08:36 AM
Elapsed time when separate cells contain time and separate date Gnugs New Users to Excel 1 March 7th 07 08:48 AM
How to chnge 35 relative cells to 35 absolute cells at one time. Susan A at Millennium Medical Excel Worksheet Functions 3 March 7th 06 08:12 PM
add time to cells Michael H. Cox Excel Worksheet Functions 1 May 20th 05 12:43 AM


All times are GMT +1. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"