total hours worked calculation with breaks

jsgjr

New Member
Joined
Jan 23, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I am trying to figure out a way to calculate the total hours scheduled with break. I know there is an "IF" function, but I do not know how to add it to the current formula.

This is the current formula which calculates the time "shift end-shift start" in column "P". But if someone is working more than 5 hours, I would like the formula to subtract 30 mins for break. Is this possible?
=(C9-B9)*24+(E9-D9)*24+(G9-F9)*24+(I9-H9)*24+(K9-J9)*24+(M9-L9)*24+(O9-N9)*24

thank you in advance for your help!
 

Attachments

  • 20230122_23333144.png
    20230122_23333144.png
    51.7 KB · Views: 19

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
for each shift can you do something like IF(EndTime - BegTime > 5/24, EndTime - BegTime - 1/48, EndTime - BegTime),
There are probably some more efficient ways to do that, but this is straightforward. The only concern is if the BegTime is in next day, then you'd have to do an If to add 1 day before the subtraction.
 
Upvote 0

Forum statistics

Threads
1,215,223
Messages
6,123,722
Members
449,116
Latest member
Aaagu

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