Counting hours spent ( within certain shift hours) between two dates.

AhmadHamouda25

New Member
Joined
Apr 21, 2024
Messages
1
Office Version
  1. 2021
Platform
  1. Windows
Hello, I'm looking for a solution or equation to my problem :(

I have to count how many hours employees worked on cases during two shifts "day shift" 5:00-17:00, and other "night shift" (17:00-5:00).

I have no idea how to make it with one equation but I know the other would be subtraction from duration hopefully! any help please? :(

Raw_Data_1713471755929.xlsx
ABCDE
1Start DateEnd DateDurationHours between 5 - 17Hours between 17 - 5
210/1/2023 0:1910/6/2023 19:47139:28139:28
Sheet1
Cell Formulas
RangeFormula
C2C2=B2-A2
E2E2=C2-D2
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
try:
Excel Formula:
night shift=INT(B2-A2)*12-IF(MOD(A2,INT(A2))>17/24,MOD(A2,INT(A2))*24-17,0)+IF(MOD(B2,INT(B2))>17/24,MOD(B2,INT(B2))*24-17,0)
,
Excel Formula:
day shift=(B2-A2)*24-night shift
 
Upvote 0

Forum statistics

Threads
1,215,409
Messages
6,124,737
Members
449,185
Latest member
hopkinsr

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