Hi, all,
I have data downloaded from a source that provides the time
as 5-6 digits. E.g., 94423, 132218, etc. I want to show it
as hh:mm:ss. So: 09:44:23, 13:22:18, etc. I've tried various
custom-formatting things but can't get it to come out right.
Can it be done simply with formatting, or do I need to resort
to a formula? Help sincerely appreciated.
By the way, for doing it via formula I found this:
=SUM(MID(A1,{1,3},2)/{24,1440})
I found that here:
http://www.mrexcel.com/archive/Formulas/4699.html
I like it, but the problem with applying it to my case
is (a) my data includes seconds; and (b) my data is not
always 6 digits long: there is not a leading zero in what
I download from the source.
Thanks,
Dallman
Fred Smith - 18 May 2008 13:39 GMT
For a custom format, use:
00\:00\:00
To convert to a real Excel time, use:
=time(int(a1/10000),mod(int(a1/100),100),mod(a1,100))
Regards,
Fred.
> Hi, all,
>
[quoted text clipped - 19 lines]
> Thanks,
> Dallman
Dallman Ross - 18 May 2008 20:32 GMT
Excellent on both counts! Thank you, Fred.
I didn't see before that ":" needs to be quoted
in the custom format. And that formula's the
cat's meow!
Dallman
--------------------------------------
> For a custom format, use:
>
[quoted text clipped - 28 lines]
> >
> > Thanks, Dallman
daddylonglegs - 18 May 2008 21:31 GMT
You can also convert with this formula
=TEXT(A1,"00\:00\:00")+0
format result cell as hh:mm:ss
> Excellent on both counts! Thank you, Fred.
> I didn't see before that ":" needs to be quoted
[quoted text clipped - 36 lines]
> > >
> > > Thanks, Dallman
Dallman Ross - 20 May 2008 00:03 GMT
Very nice!
I don't follow the +0 at the end, though. I guess you
are expecting it to cause some sort of data coersion?
But when I leave the +0 off, the formula seems to work
equally well.
Dallman
--------------------------------------
> You can also convert with this formula
>
[quoted text clipped - 42 lines]
> > > >
> > > > Thanks, Dallman
Dave Peterson - 20 May 2008 00:34 GMT
Without the +0, the value returned from the formula is a string. It'll look
like a time.
With the +0, you'll see a number. And if you apply the nice number format,
it'll actually be a time.
> Very nice!
>
[quoted text clipped - 53 lines]
> > > > >
> > > > > Thanks, Dallman

Signature
Dave Peterson
Dallman Ross - 21 May 2008 00:30 GMT
Ah, I see. Of course. Thank you, Dave.
I do believe that it works because of what the CS folks would call
"type-casting" or "coercion," unless I am mistaken. In any case,
very nice soloution from DaddyLongLegs.
Dallman
> Without the +0, the value returned from the formula is a string. It'll look
> like a time.
[quoted text clipped - 18 lines]
> > >
> > > format result cell as hh:mm:ss