Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default Converting Time

I get a file that displays time as 0515A. I need to convert it to 05:15 AM.
I use the mid function to retrieve the hour, minutes and A or P. I then
rebuild the string as 05:15 AM and write it to a cell.

Before writing it to a cell, I format the cell as "hh:mm AM/PM".

When I look at the cell, I see 05:15 AM. However, the actual cell value is
05:15:00 AM.

Is there a format or way to make the actual cell value as 05:15 AM instead of
05:15:00 AM?

Thanks for the help......
--
JT
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Converting Time

Format as text as you are building a text string.
dm

"JT" wrote:

I get a file that displays time as 0515A. I need to convert it to 05:15 AM.
I use the mid function to retrieve the hour, minutes and A or P. I then
rebuild the string as 05:15 AM and write it to a cell.

Before writing it to a cell, I format the cell as "hh:mm AM/PM".

When I look at the cell, I see 05:15 AM. However, the actual cell value is
05:15:00 AM.

Is there a format or way to make the actual cell value as 05:15 AM instead of
05:15:00 AM?

Thanks for the help......
--
JT

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Converting Time

Format as text as you are building a text string.

....or leave it the way you have it now (as a date), but use the Text
property of the Range object when building a text string in code (VBA); or
use the TEXT function to format it the way you want when building a text
string in a worksheet formula.

--
Rick (MVP - Excel)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Converting Time

Actually when you enter the time as 05:15 AM, for excel the actual
cell value will be 05:15:00 AM as excel assumes that second part is
zero as you have not mentioned it.

I believe, there is nothing wrong if excel shows seconds as zero.
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
Converting Standard Time to Military Time in Excel mtvschultz Excel Discussion (Misc queries) 3 May 5th 23 11:42 AM
formula for converting military time to standard time, etc Pattio Excel Discussion (Misc queries) 8 February 17th 08 01:12 AM
Converting date/time serial values to cumulative time totals... Kevin B Excel Discussion (Misc queries) 4 October 18th 07 05:05 PM
Converting time formats into actual time(minutes) LeighM Excel Discussion (Misc queries) 2 October 30th 06 05:15 AM
Converting decimal time to standard time? mpendleton Excel Discussion (Misc queries) 4 May 12th 06 10:07 PM


All times are GMT +1. The time now is 03:53 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"