Calculate overtime/lost time from a range of cells.

xblft1

New Member
Joined
Sep 11, 2018
Messages
9
Hi all,

I have a table of how many hours each employee worked in each day of the month.
I am trying to calculate their overtime and any time loss without having to create new tables.

Sumifs was my 1st thought however it adds cell values where what i want is to add the cell value minus 8:00:00 when this is not negative.

Example of what the data looks like:

Employee 1: 8:32:08, 8:35:13, 7:53:00

The result here should be 1:07:21 (overtime from the 1st two days, no discount for the 3rd day as the loss is to be calculated separately).

My data is a large number of staff for a whole month (and possibly will be a periodic task) so I'm looking for formulas to get those figures for each employee easily.

Any help would be greatly appreciated.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
No, apologies if confusing.
My table has a column for each day of the month and a line for each employee. I can make a mock table if need be.
 
Upvote 0
Day 1Day 2Day 3...
Employee 18:32:088:35:137:53:00...
Employee 28:11:148:22:178:01:13...

<tbody>
</tbody>


This is what my data looks like.
I am trying to avoid the need to create a separate table that calculates overtime for each particular day.
As mentioned before, the formula should compare the daily registered hours to 8:00:00 and sum up the non-negative differences.

Many thanks again for looking.
 
Upvote 0
Ok maybe one of these:

=SUMPRODUCT(--(B2:AF2>TIME(8,0,0)),(B2:AF2-TIME(8,0,0)))
=SUMIFS(B2:AF2,B2:AF2,">"&TIME(8,0,0))-(TIME(8,0,0)*COUNTIFS(B2:AF2,">"&TIME(8,0,0)))
 
Upvote 0

Excel 2010
ABCDEF
18:00:00Day 1Day 2Day 3
2Employee 18:32:088:35:137:53:0001:07:21
3Employee 28:11:148:22:178:01:1300:34:44
4
5or
68Day 1Day 2Day 3
7Employee 18:32:088:35:137:53:001.12
8Employee 28:11:148:22:178:01:130.58
9
6a
Cell Formulas
RangeFormula
F2=SUMPRODUCT(--(B2:E2>$A$1),(B2:E2-$A$1))
F7=SUMPRODUCT(--(B7:E7*24>$A$6),(B7:E7*24-$A$6))
 
Upvote 0
Thank you both for the swift responses.
How would those look for calculating time loss?
Here I am looking only to count the days where they worked below 8hrs. I am trying to adapt the formulas but I seem to be missing something.
 
Upvote 0
Forgot to mention - I have days where they worked 0 hours in the list. My trouble is preventing the formula from returning -8 hours for those (when calculating time loss).

many thanks again.
 
Upvote 0
Day 1Day 2Day 3Day 4
Employee 18:32:088:35:137:53:000:00:00
Employee 28:11:148:22:178:01:130:00:00
Employee 37:32:220:00:008:08:118:11:22

<tbody>
</tbody>

A sample table to show my issue when trying to calculate time loss.
Employee 1 has 0:07:00 time loss (7 min on day 3, none on Day 1&2, didn't work on Day 4)
Employee 2 should return 0:00:00
Employee 3 should return 0:27:44

Not sure how to exclude the days with zero worked hours from the results.

Thank you for looking.
 
Upvote 0
A few examples would be useful.


Excel 2010
ABCDEF
10Employee 18:32:088:35:134:53:0003:07:00
11Employee 28:11:144:22:178:01:1303:37:43
12
13or
148Day 1Day 2Day 3
15Employee 18:32:088:35:134:53:003.12
16Employee 28:11:144:22:178:01:133.63
17
6a
Cell Formulas
RangeFormula
F10=SUMPRODUCT(--(B10:E10<$A$1),--(B10:E10>0),($A$1-B10:E10))
F15=SUMPRODUCT(--(B15:E15*24<$A$14),--(B15:E15>0),($A$14-B15:E15*24))
 
Upvote 0

Forum statistics

Threads
1,215,422
Messages
6,124,808
Members
449,191
Latest member
rscraig11

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