Excel Guides

How to Calculate Average Overtime per Employee-Week in Excel

A dashboard shows 24 hours above the weekly threshold. Is that 2, 4, or 8 hours per employee-week? In this example it is 4. The other answers come from counting a different set of weeks.

A Microsoft Fabric Community question asked how to keep future weeks out of a year-to-date overtime average. If employees start at different times, there is another decision to make. Each closed week contributes one row for each employee eligible that week, including employees who had zero hours above the threshold.

Build the list of weeks that count

Synthetic example. Weeks W01 through W04 are closed. W05 and W06 are still in the future. A is eligible from W01 and B from W03. The example uses whole weeks and a fictional 40-hour management threshold. It measures workload and does not calculate payroll.

Create three sheets named Roster, Hours and Summary. Paste or import each comma-separated block starting at A1 on the corresponding sheet. On Roster, the six rows represent the eligible closed weeks, derived from the calendar and employee assignments. Keep this list independent of the hours file so a missing submission cannot remove a week from the count.

Employee,Week
A,W01
A,W02
A,W03
A,W04
B,W03
B,W04

On Hours, use one weekly total per employee and week. In this exercise the totals are already grouped and approved. If your export contains daily entries, check that the week is complete and group the entries by employee and week before applying the threshold.

Employee,Week,Total hours,Approval
A,W01,48,Approved
A,W02,32,Approved
A,W03,44,Approved
A,W04,36,Approved
B,W03,52,Approved
B,W04,40,Approved

Match each week to its approved hours

Enter 40 in Summary!B1. On Hours, put Valid in E1. Enter this in E2 and fill through E20. A numeric zero is allowed. A blank, text value, negative value or unapproved row fails the check.

=IFERROR(IF(AND(ISNUMBER(C2),C2>=0,D2="Approved"),1,0),0)

On Roster, use the headers Matches, Status and Excess in C1:E1. Enter the formulas below in C2, D2 and E2 respectively, then fill through row 7. A week must appear once in the roster and have exactly one valid source row.

=COUNTIFS(Hours!$A$2:$A$20,A2,Hours!$B$2:$B$20,B2)
=IF(AND(A2<>"",B2<>"",COUNTIFS($A$2:$A$7,A2,$B$2:$B$7,B2)=1,C2=1,COUNTIFS(Hours!$A$2:$A$20,A2,Hours!$B$2:$B$20,B2,Hours!$E$2:$E$20,1)=1),"OK","Review")
=IF(D2="OK",MAX(SUMIFS(Hours!$C$2:$C$20,Hours!$A$2:$A$20,A2,Hours!$B$2:$B$20,B2)-Summary!$B$1,0),"")

Microsoft documents how COUNTIFS matches multiple criteria. The ranges in this exercise are fixed. For a recurring report, use Excel Tables or extend the ranges on every refresh.

Divide by eligible employee-weeks

On Summary, enter the following formulas in B2 through B5, in order. They return the count of eligible weeks across employees, the number of rows to review, the total excess hours and the pooled average.

=COUNTA(Roster!A2:A7)
=COUNTIF(Roster!D2:D7,"Review")
=IF(OR(B2=0,B3>0),"Review inputs",SUM(Roster!E2:E7))
=IF(ISNUMBER(B4),B4/B2,"Review inputs")

A contributes 8 + 0 + 4 + 0 = 12 hours across four weeks. B contributes 12 + 0 = 12 hours across two weeks. The total is 24 hours across six employee-weeks, or 4 per employee-week.

Counting all six calendar weeks for both employees gives 24 ÷ 12 = 2. Counting only the three weeks with excess gives 24 ÷ 3 = 8. Averaging A’s rate of 3 and B’s rate of 6 gives 4.5 because each employee receives equal weight. That measure can be useful when every employee is meant to count equally.

Apply the threshold before summing across weeks. A logged 160 hours across four weeks. Comparing that total with 4 × 40 gives zero, even though A had 12 hours above the threshold in individual weeks.

Try deleting the A/W01 hours record or changing its Approval to Draft. The full rate should show Review inputs. Restore the record, then enter an approved numeric zero for A/W02. Six weeks still count and the rate is still 4.

Refresh the check in Power Query or review it in Jolene.pro

For recurring imports, use Power Query Group By to form weekly hours, with approval and completeness checked before the totals are used. Start the left outer merge from the eligible roster and match on both employee and week. Flag a missing match or multiple matches before calculating excess hours.

If you already have the report in an Excel workbook, use Jolene.pro as a second check. Ask it to list each included employee-week with the approved hours and source cells, flag missing or duplicate keys, and show the numerator and denominator separately. Comparing that list with the dashboard helps locate which records drove the difference. The spreadsheet formulas were checked independently. A live Jolene.pro result was not verified.

For a related check, see how to find missing timesheets before reporting project costs. Explore more examples in Workbook Studies.

1 comment

Leave a comment