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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
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,223,939
Messages
6,175,531
Members
452,651
Latest member
wordsearch

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