Change Text entered time to Time format.

RD9686

New Member
Joined
Apr 25, 2018
Messages
2
Hi All,

I have a formula to change text entered time ("10:00am") to time format as below, is there a short form of this?

=IF(ISNUMBER(SEARCH("am",T2))=TRUE,TIMEVALUE(SUBSTITUTE(T2,"am"," am")),IF(ISNUMBER(SEARCH("pm",T2))=TRUE,TIMEVALUE(SUBSTITUTE(T2,"pm"," pm"))))
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Maybe...

=IF(T2<>"",--REPLACE(T2,6,," "))

M.

Thank you for your reply, my intention is to get the text format time to be converted to any excel time format, as 10:00:00 AM or 10:00 AM
The above formula result to
"10:00a m"

<tbody>
</tbody>
 
Upvote 0
It worked for me


T
U
1
Text​
Time​
2
10:00am​
0,416667​
3
10:00pm​
0,916667​

Formula in U2 copied down
=IF(T2<>"",--REPLACE(T2,6,," "))

Then you can format U2:U3 as Time achieving...

T
U
1
Text​
Time​
2
10:00am​
10:00:00​
3
10:00pm​
22:00:00​

M.
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,107
Members
449,205
Latest member
ralemanygarcia

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