Convert text to time

logstarter

New Member
Joined
Apr 14, 2017
Messages
39
Hi,

I have a column of time showing like "01-JAN-19 03:23:22.120000 AM", I would like to ask how I could convert this text to time.

Thank you for your help.
 
I am not sure why my first formula did not work for you as it worked fine for me. Whatever, does this formula work for you...

=TIMEVALUE(LEFT(A1,18))


IGNORE THIS FORMULA... It does not account for PM time values.
 
Last edited:
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
T202009c.xlsm
ABCDE
101-JAN-19 03:23:22.120000 AM03:23:2203:23:2203:23:2203:23:22
201-JAN-19 03:23:22.120000 PM15:23:2215:23:2215:23:2215:23:22
3note 1
4
1b
Cell Formulas
RangeFormula
B1:B2B1=--MID(A1,11,99)
C1:C2C1=MOD(A1,1)
D1:D2D1=--REPLACE(A1,1,10,"")
E1:E2E1=IF(RIGHT(A1,2)="AM", TIME(MID(A1,11,2), MID(A1,14,2), MID(A1,17,2)), TIME(MID(A1,11,2)+12, MID(A1,14,2), MID(A1,17,2)))


Each of the suggestions seems to yield the correct answer.
N.B. Format the number as time.
Note 1 Ignore D1:D2 see C1:C2.
What version of Excel are you using?
Did you try the suggestions?
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

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