Separate Time Intervals

JoeExcelHelp
5StarLounger
Posts: 1177
Joined: 22 Jul 2013, 18:29

Separate Time Intervals

Post by JoeExcelHelp »

Hi Everyone,

I'm trying to separate 1 time interval into 2 intervals
Example,
21:00-02:00 would be 21:00-00:00, 00:01-02:00
Basically anytime a time passes midnight it would start the 2nd interval at 00:01-....

Thanks in advance

User avatar
HansV
Administrator
Posts: 78565
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Separate Time Intervals

Post by HansV »

Can you give use an idea what the input looks like and how you would want the outpit?
Best wishes,
Hans

JoeExcelHelp
5StarLounger
Posts: 1177
Joined: 22 Jul 2013, 18:29

Re: Separate Time Intervals

Post by JoeExcelHelp »

This is what my data looks like in column A 21:00-02:00 and this is what I would like Column B 21:00-00:00, Column C 00:01-02:00

User avatar
HansV
Administrator
Posts: 78565
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Separate Time Intervals

Post by HansV »

It would be much better to store the start and end times in separate columns, but with the current setup: assuming that the data start in A2, enter the following formulas in B2 and C2:

=LEFT(A2,6)&IF(RIGHT(A2,5)<LEFT(A2,5),"00:00",RIGHT(A2,5))

=IF(RIGHT(A2,5)<LEFT(A2,5),"00:01"&RIGHT(A2,6),"")
Best wishes,
Hans

JoeExcelHelp
5StarLounger
Posts: 1177
Joined: 22 Jul 2013, 18:29

Re: Separate Time Intervals

Post by JoeExcelHelp »

Thanks Hans, unfort I dont have control over the data im using