Formula problem: Timesplit

blaksnm

Well-known Member
Joined
Dec 15, 2009
Messages
554
Office Version
  1. 365
Platform
  1. Windows
Hi
After some hours of strugling I have to ask for help:
I have a time-registration-schedule with "Ins and "Out"s - (cells A2:An and B2:Bn)
This time-summary is to be split accordingly in 4 "sones" by formulas; 00:00->08:00 (Cells C2:Cn) / 08:00=->16:00 (Cells D2:Dn) / 16:00=>20:00 (Cells E2:En)and 20:00=>24:00 (Cells F2:Fn)

Will anyone please give me a hand to get the formulas right?

Best Regards
Snoopy
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi Snoopy,

I know sones as a measure of volume so I'm a bit confused. I suspect you want the in time and out time split into minutes overlapped with your time ranges? If so can the Out time be less than the In time, suggesting the Out is the next day?

Some worked examples would be helpful, preferably using XL2BB
 
Upvote 0
Thanks for taking interest in this problem

I will download XL2BB
Meanwhile: Her is my expectet results (Sone=time interval, Result=time-summary formatted as decimals):

Some examples:
Input time I-- Sone1 ---I--- Sone2 ---I-- - Sone3 ---I--- Sone4 ---I
Column A B C D E F G
Row 01 In Out 00:00-08:00 08:00-16:00 16:00-20:00 16:00-20:00 I--- Total ---I
Row 02 07:30 07:45 0,25 0,00 0,00 0,00 0,25
Row 03 07:45 08:30 0, 25 0,50 0,00 0,00 0,75
Row 04 07:00 16:15 1,00 8,00 0,25 0,00 0,00
Row 05 15:00 16:15 0,00 1,00 0,25 0,00 0,00
Row 06 15:00 20:30 0,00 1,00 4,00 0,50 0,00
Row 07 20:15 20:30 0,00 0,00 0,00 0,25 0,00
Row 07 22:15 22:30 0,00 0,00 0,00 0,25 0,00

I hope this will clarify a bit

Best Regards Snoopy
 
Upvote 0
Thanks for taking interest in this problem

I will download XL2BB
Meanwhile: Her is my expectet results (Sone=time interval, Result=time-summary formatted as decimals):
Problem: design formulas that split the registrated use of time into time-intervals as followed

Some examples:
Reg In
Reg Out
00:00-08:00
08:00-16:00
16:00-20:00
16:00-20:00
20:00-24:00
Total
07:30​
07:45​
0,25​
0,25
07:00​
08:30​
1,00​
0,50​
1,50
06:00​
16:15​
2,00​
8,00​
0,25​
11,25
15:00​
17:15​
1,00​
1,25​
2,25
20:15​
20:30​
0,25​
0,25
22:15​
23:30​
1,25​
1,25
7:45​
23:30​
0,25​
8,00​
4,00​
4,00​
3,50​
19,75
I hope this will clarify a bit

Best Regards Snoopy
 
Upvote 0
Hi Snoopy,

You didn't answer about overlapping days, i.e. Reg Out time being less than Reg In time suggesting it overlaps midnight. This solution does not address that scenario.

There is no such time as 24:00 so I've used 23:59:59 as the last upper bound.

You had two entries for 16:00-20:00 so I've split that into 16:00-20:00, 20:00-22:00 and made the last bound 22:00-23:59.

My calculations disagree with your example in two cases: Rows 5 and 9.

Excel does not do well interpreting strings as numbers so I've split the lower/upper bounds into two rows.

NOTE: You can suppress the 0:00 cells by using custom format 0.00;;#

Blacksnm.xlsx
ABCDEFGH
10:008:0016:0020:0022:00
2Reg InReg Out8:0016:0020:0022:0023:59Total
37:307:450.250.000.000.000.000.25
47:008:301.000.500.000.000.001.50
56:0016:152.008.000.250.000.0010.25
615:0017:150.001.001.250.000.002.25
720:1520:300.000.000.000.250.000.25
822:1523:300.000.000.000.001.251.25
97:4523:300.258.004.002.001.5015.75
1st
Cell Formulas
RangeFormula
C3:G9C3=(MAX(MIN(C$2,$B3)-MAX(C$1,$A3),0))*24
H3:H9H3=SUM(C3:G3)
 
Last edited:
Upvote 0
Hi Snoopy,

You didn't answer about overlapping days, i.e. Reg Out time being less than Reg In time suggesting it overlaps midnight. This solution does not address that scenario.

There is no such time as 24:00 so I've used 23:59:59 as the last upper bound.

You had two entries for 16:00-20:00 so I've split that into 16:00-20:00, 20:00-22:00 and made the last bound 22:00-23:59.

My calculations disagree with your example in two cases: Rows 5 and 9.

Excel does not do well interpreting strings as numbers so I've split the lower/upper bounds into two rows.

NOTE: You can suppress the 0:00 cells by using custom format 0.00;;#

Blacksnm.xlsx
ABCDEFGH
10:008:0016:0020:0022:00
2Reg InReg Out8:0016:0020:0022:0023:59Total
37:307:450.250.000.000.000.000.25
47:008:301.000.500.000.000.001.50
56:0016:152.008.000.250.000.0010.25
615:0017:150.001.001.250.000.002.25
720:1520:300.000.000.000.250.000.25
822:1523:300.000.000.000.001.251.25
97:4523:300.258.004.002.001.5015.75
1st
Cell Formulas
RangeFormula
C3:G9C3=(MAX(MIN(C$2,$B3)-MAX(C$1,$A3),0))*24
H3:H9H3=SUM(C3:G3)
Sorry
No overlapping days - timeregistration is day-by-day only
Br S
 
Upvote 0
Hi Snoopy,

You didn't answer about overlapping days, i.e. Reg Out time being less than Reg In time suggesting it overlaps midnight. This solution does not address that scenario.

There is no such time as 24:00 so I've used 23:59:59 as the last upper bound.

You had two entries for 16:00-20:00 so I've split that into 16:00-20:00, 20:00-22:00 and made the last bound 22:00-23:59.

My calculations disagree with your example in two cases: Rows 5 and 9.

Excel does not do well interpreting strings as numbers so I've split the lower/upper bounds into two rows.

NOTE: You can suppress the 0:00 cells by using custom format 0.00;;#

Blacksnm.xlsx
ABCDEFGH
10:008:0016:0020:0022:00
2Reg InReg Out8:0016:0020:0022:0023:59Total
37:307:450.250.000.000.000.000.25
47:008:301.000.500.000.000.001.50
56:0016:152.008.000.250.000.0010.25
615:0017:150.001.001.250.000.002.25
720:1520:300.000.000.000.250.000.25
822:1523:300.000.000.000.001.251.25
97:4523:300.258.004.002.001.5015.75
1st
Cell Formulas
RangeFormula
C3:G9C3=(MAX(MIN(C$2,$B3)-MAX(C$1,$A3),0))*24
H3:H9H3=SUM(C3:G3)
I think you just made my day :)
Thank you so very much!
 
Upvote 0

Forum statistics

Threads
1,214,629
Messages
6,120,630
Members
448,973
Latest member
ChristineC

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