Text String to time

Mark McInerney

Active Member
Joined
Apr 4, 2012
Messages
288
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm working with a range of cells where the client has entered times as text strings and all into the one cell e.g. 9.00-14.00, 15.00-21.00

They are working on a 24 hour time with 2pm entered as 14.00

is it possible to extract the start time and the end time and covert them into times that I can use in other formulas?

Thanks for any help - appreciated - Mark.
 
Time 2023.xlsm
DEFGHIJK
3#6#7#7 without MOD#8
49.00-14.005:005:005:005:00
515.00-21.006:006:006:006:00
66.08-10.594:514:514:514:51
79.55-23.0113:0613:0613:0613:06
818.15-6.00time spans midnight11:4511:4511:4511:45
9
2g
Cell Formulas
RangeFormula
H4:H8H4=LET(t,--TEXTSPLIT(SUBSTITUTE(D4,".",":"),"-"),INDEX(t,2)-INDEX(t,1)+(INDEX(t,1)>INDEX(t,2)))
I4:I8I4=LET(t,TEXTSPLIT(SUBSTITUTE(D4,".",":"),"-"),MOD(INDEX(t,2)-INDEX(t,1),1))
J4:J8J4=LET(t,TEXTSPLIT(SUBSTITUTE(D4,".",":"),"-"),MOD(INDEX(t,2)-INDEX(t,1),1))
K4:K8K4=SUM(MOD(TEXTSPLIT(SUBSTITUTE(D4,".",":"),"-")*{-1,1},1))
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
If the time spans midnight, our suggestions calculate the correct time.
Fair enough, I had missed that. However, the thread has diverted a fair way from the original question and data so I'm leaving it alone now unless we hear more from the OP.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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