marduk87RP
New Member
- Joined
- Aug 31, 2020
- Messages
- 1
- Office Version
- 2016
- Platform
- Windows
I have a situation like this:
In one cell, I split the time ranges over several lines, for example
07: 15-10: 27
10: 35-11: 00
11: 15-12: 27
13: 15-13: 27
14: 15-18: 27
19: 15-20: 27
21: 15-23: 39
I know it would be more logical to have an hourly range divided over several lines, unfortunately I can't do otherwise ... I tried this formula:
RIGHT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(0)*LEN($G8)+1;LEN($G8)));".";":");5)-LEFT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(0)*LEN($G8)+1;LEN($G8)));".";":");5)+(RIGHT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(1)*LEN($G8)+1;LEN($G8)));".";":");5)-LEFT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(1)*LEN($G8)+1;LEN($G8)));".";":");5))
But this formula only calculates the first row(To the eye the calculation is also wrong) and doesn't consider the others, is there a way, a formula to do this, calculate the time differences and then add the total
In one cell, I split the time ranges over several lines, for example
07: 15-10: 27
10: 35-11: 00
11: 15-12: 27
13: 15-13: 27
14: 15-18: 27
19: 15-20: 27
21: 15-23: 39
I know it would be more logical to have an hourly range divided over several lines, unfortunately I can't do otherwise ... I tried this formula:
RIGHT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(0)*LEN($G8)+1;LEN($G8)));".";":");5)-LEFT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(0)*LEN($G8)+1;LEN($G8)));".";":");5)+(RIGHT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(1)*LEN($G8)+1;LEN($G8)));".";":");5)-LEFT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(1)*LEN($G8)+1;LEN($G8)));".";":");5))
But this formula only calculates the first row(To the eye the calculation is also wrong) and doesn't consider the others, is there a way, a formula to do this, calculate the time differences and then add the total