calculating overtime idea

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I want to write a formula to calculate overtime. If the total hrs worked is more than 8 then that is overtime

I thought abut this formula but did not work. It only work if the difference is 1hrs and above. if it is 1/2hr then I get garbage number.

= max(A1-8,0)

[TABLE="class: grid, width: 199"]
<tbody>[TR]
[TD]total hrs worked[/TD]
[TD]overtime[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD="align: right"]1.59872E-14[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD="align: right"]6[/TD]
[/TR]
</tbody>[/TABLE]

Any other formula will be ok as well. thank you so much.
 
Last edited:

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Excel 2010
ABCD
1total hrs workedovertime
280.00format 2 decimal places
39.51.50
410.252.25
540.00
6146.00
4a
Cell Formulas
RangeFormula
B2= MAX(A2-8,0)
B3= MAX(A3-8,0)
B4= MAX(A4-8,0)
B5= MAX(A5-8,0)
B6= MAX(A6-8,0)
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,620
Latest member
dsubash

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