Convert to Time

Border Terrier

New Member
Joined
Aug 31, 2005
Messages
23
You have all been so helpful in the past, so here goes again.

In column A, starting in A4 i have times imported as follows,

155656
102630
092536

Now using the formula =TIME(LEFT(A4,2),MID(A4,3,2),RIGHT(A4,2)) in B4 and pasted down, the result in B4 is 15:56:56 in B5 is 10:26:30, this is fine.

Now the problem is in B6, the zero gets ignored and returns 20:53:36 instead of 09:25:35.

Any help to overcome this is appreciated.
Simon
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

patrickmuldoon99

Active Member
Joined
Jun 27, 2006
Messages
345
I have simulated your problem on my computer, and it worked fine if the value 092536 is formatted as text

HTH
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I can't duplicate your problem either, but this formula should also work, format result cells as time.

=TEXT(A4+0,"00\:00\:00")+0
Book1
ABCD
415565615:56:56
510263010:26:30
60925369:25:36
Sheet1
 

Border Terrier

New Member
Joined
Aug 31, 2005
Messages
23
Thanks both of you for your speedy replies.

Indeed patrickmuldoon99, i should of had them formatted as text, thanks for the help.

And HOTPEPPER, your solution works fine leaving them formatted as General, thank you.

Thank again,
Simon
 

Forum statistics

Threads
1,136,992
Messages
5,679,018
Members
419,799
Latest member
APInfa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top