Convert 100 to 0100

rdstagg

New Member
Joined
Oct 29, 2003
Messages
44
I am trying to convert times.
I am using
=TIME(LEFT(H2,2),RIGHT(H2,2),0)
The only problem I have is the times from 100(1 am) to 900(9am) where I am missing the extra zero at the front.
I know there must be a simple way round this but I can't seem to do it!!

0 = midnight = 00:00
100 = 1am = 01:00
200 = 2am = 02:00 etc
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Maybe...

=IF(LEN(A1)=1,TIME(0,0,0),IF(LEN(A1)=3,TIME(LEFT(A1),RIGHT(A1,2),0),TIME(LEFT(A1,2),RIGHT(A1,2),0)))

Hope this helps!
 
Upvote 0
Zilpher - tried that - didn't work
domenic - many thanks -superb piece of work and all resolved in under 30 mins - what a marvellous resource this forum is.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

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
Back
Top