Excel Formula

sunnylv

New Member
Joined
Feb 29, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have an excel report with the time expressed in written text in Column A. (example: 2h 30m 14s). I would like to format in Column B as 02:30:14. Can I use Left, Mid, and Rght formulas together to achieve this?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Welcome to the Board!

For a value in cell A1:
Excel Formula:
=TEXT(TIMEVALUE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"h ",":"),"m ",":"),"s","")),"hh:mm:ss")

Note that will return a Text value. If you need it to be a valid time value that you can do math on, use this version:
Excel Formula:
=TIMEVALUE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"h ",":"),"m ",":"),"s",""))
and simply apply a custom format on the cell of "hh:mm:ss"
 
Upvote 0
Solution
You are welcome.
Glad I was able to help!
 
Upvote 0
Since you have Excel 365:
=--TEXTJOIN(":",,TEXTSPLIT(A1,{"h ","m ","s"}))

Format as hh:mm:ss
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,203
Messages
6,123,627
Members
449,109
Latest member
Sebas8956

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