Warm tip: This article is reproduced from serverfault.com, please click

formula to find the difference between time with a conditions

发布于 2020-11-28 03:41:28

I'm trying to make a formula to find the difference between 2 time, and also have a condition like this :

If work time > 8 hours, then the difference from work time become the overtime

And here's the image of my table in Excel : the table Can you please tell me what to write the formula?

Questioner
Terizla Smith
Viewed
0
Hooded 0ne 2020-11-28 11:55:09

Formula for worktime

=F2-E2

Formula for Overtime

=MAX(G2-(1/3),0)

enter image description here

If you would like the work time and overtime to be formatted as number (e.g 1 instead of 1:00), use the formulas below and format your cells to be numbers

=(F2-E2)*24 =MAX(G2-8,0)