ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Time format problem (https://www.excelbanter.com/excel-programming/293512-time-format-problem.html)

sandy

Time format problem
 
the time like
9:00:00AM was displayed as 4292552277.375 in excel
12:00:00PM was displayed as 4292552277.5 in excel

Can any one help me how to display in normal format
9:00:00AM ?

Rick[_19_]

Time format problem
 

-----Original Message-----
the time like
9:00:00AM was displayed as 4292552277.375 in excel
12:00:00PM was displayed as 4292552277.5 in excel

Can any one help me how to display in normal format
9:00:00AM ?
.


Did you try Format-Cells-Number-Time?

The programming language for this is (for the activecell):

ActiveCell.NumberFormat = "h:mm:ss AM/PM"

sandy

Time format problem
 
TRIED. But the following appears:
############################

so strange...

Frank Kabel

Time format problem
 
Hi Sandy
who did you get this numeric entry (by code or manual entry). As this
could never be the numeric representation of 09:00:00 (the value should
be below 1.0)
So also a format conversion won't help (as you stated in one of your
follow-ups)

--
Regards
Frank Kabel
Frankfurt, Germany

sandy wrote:
the time like
9:00:00AM was displayed as 4292552277.375 in excel
12:00:00PM was displayed as 4292552277.5 in excel

Can any one help me how to display in normal format
9:00:00AM ?



sandy

Time format problem
 
The excel file was generated by crystal report from my
company's system.


sandy

Time format problem
 
thanks sandy, i found the reason!
9:00:00AM was displayed as 4292552277.375 in excel

actually only .375 is useful, 0.375 = 9:00:00AM !!!
i think the programmer added some time stamp before the
dot.
Thanks for reminding me time is less than 1.0

Frank Kabel

Time format problem
 
O.k.
so you might try to convert this column with
=INT(A1)
copy this down and format this column as 'Time'

--
Regards
Frank Kabel
Frankfurt, Germany

sandy wrote:
thanks sandy, i found the reason!
9:00:00AM was displayed as 4292552277.375 in excel

actually only .375 is useful, 0.375 = 9:00:00AM !!!
i think the programmer added some time stamp before the
dot.
Thanks for reminding me time is less than 1.0


Rick[_19_]

Time format problem
 
Hi,

Sorry, I'm late in replying. If you read this, it might
be because Excel is not recognizing it as a valid number
for that time. For example, if you multiply today's date
by a negative number or a very large number like 100,
you'll get the same result as you have experienced.

I suppose you know that today's date could be a formula in
a cell like this: =today()

-----Original Message-----
TRIED. But the following appears:
############################

so strange...
.


Rick[_19_]

Time format problem
 
OK. I see you got it all figured out. I didn't read down
far enough, before I sent off the last reply.

-----Original Message-----
TRIED. But the following appears:
############################

so strange...
.



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com