Calculating time difference when time starts before 00:00 and finishes after 00:01

Drexl88

Board Regular
Joined
Jan 20, 2020
Messages
75
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am using the below to calculate time spent on certain activities by staff and to calculate the total time on task for all staff. The issue I have is that when the time commenced is before 00:00 and the time ceased in after 00:01 the formula does not work in F11. Some staff will be carrying out tasks starting for example at 23:30 and finishing at 01:30. What formula can I use so that this time allocated works in any event.

Thanks

Enhanced Hours Record (1).xlsx
ABCDEF
8DateActivityFromToNo. of StaffTotal Time
906/01/202008:15:0008:45:00201:00:00
1008/01/202023:15:0023:30:00100:15:00
1112/01/202023:45:0000:30:003########
Jan 2020
Cell Formulas
RangeFormula
F9:F11F9=E9*(D9-C9)
Cells with Data Validation
CellAllowCriteria
B9:B30,I9:I30List=Sheet2!$A$2:$A$8
C9:D30,J9:K30List=Sheet2!$B$2:$B$97
E9:E30,L9:L30List=Sheet2!$C$2:$C$6
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try this formula in F9:F11 (XL2BB has hung my copy of excel!)
Rich (BB code):
=E9*MOD((1+D9-C9),1)
 
Upvote 0
2 alternatives;either should give the result

T202002a.xlsm
ABCDEFG
8DateActivityFromToNo. of StaffTotal TimeTotal Time
906-01-208:15:008:45:00201:00:0001:00:00
1008-01-2023:15:0023:30:00100:15:0000:15:00
1112-01-2023:45:000:30:00302:15:0002:15:00
12
6a
Cell Formulas
RangeFormula
F9:F11F9=MOD(D9-C9,1)*E9
G9:G11G9=(D9-C9+(C9>D9))*E9
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,093
Latest member
catterz66

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