If formula to calculate worked hours

sabrrrrina

New Member
Joined
Aug 23, 2023
Messages
1
Office Version
  1. 2021
  2. 2019
  3. 2016
Platform
  1. Windows
  2. MacOS
Hello!

I am trying to calculate my worked hours whilst accounting for my lunch break.
I have a 30 minute lunch break if I work more than 8 hours, but do not have a lunch break if I work 6 hours.
I want to incorporate this into my formula, so that it will calculate the hours worked and minus the lunch break if the value is over 8, but does not minus the lunch break if the value is 6.

I currently have this formula:

06:45​
15:30​
=IF(((E3-D3)*24)>8,- 0.5)​

This formula works but it inserts the value -0.50 instead of taking away 0.5 from the value after calculating E3-D3)*24 <-- that section of the formula.

In words I want: IF (15:30 minus 06:45) multiplied by 24 equals more than 8, then minus 0.5
And if the value is 6 then do not minus 0.5

I hope this makes sense...
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Welcome to the MrExcel board!

Not entirely clear, but does this do what you want?

23 08 23.xlsm
DEF
1
2
36:4515:308:15
49:4515:305:45
Hours
Cell Formulas
RangeFormula
F3:F4F3=E3-D3-IF(E3-D3>8/24,1/48,0)
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,143
Members
453,021
Latest member
Justyna P

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