Skip to main content

How to Total Hours by Person and Month in Excel with SUMIFS

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

A log of shifts answers "who worked when"; payroll asks "how many hours did each person do each month?" One SUMIFS formula, copied across a grid of names and months, answers it: it adds up Hours where the Employee matches the row and the Date falls in the column's month.

The example is the Monthly totals sheet of the old overtime timesheet from Part 1 of the Overtime Timesheet series, which reads the OvertimeLog table on the Overtime log sheet.

Prerequisites​

Step 1: Lay Out the Grid​

On the totals sheet:

Step 2: Write the Formula for the First Cell​

In B2, Aisha Khan's October total:

A code window titled Monthly totals → B2 showing =SUMIFS(OvertimeLog[Hours],OvertimeLog[Employee],$A2,OvertimeLog[Date],">="&B$1,OvertimeLog[Date],"<"&EDATE(B$1,1)), which adds this row's employee's hours for dates from this column's month start up to the next month's start

Monthly totals → B2
=SUMIFS(OvertimeLog[Hours],OvertimeLog[Employee],$A2,OvertimeLog[Date],">="&B$1,OvertimeLog[Date],"<"&EDATE(B$1,1))
PartMeans
OvertimeLog[Hours]Add up the Hours column
OvertimeLog[Employee],$A2where Employee is the name in column A of this row
OvertimeLog[Date],">="&B$1and Date is on or after this column's month start
OvertimeLog[Date],"<"&EDATE(B$1,1)and Date is before the next month's start

SUMIFS adds only the rows where every condition is true. The date conditions are explained in How to Sum Values Between Two Dates in Excel with SUMIFS, and $A2 and B$1 in How to Use Absolute and Mixed Cell References in Excel.

Cell B2 being edited with the SUMIFS formula, $A2 and B$1 highlighted in their reference colours and the Employee and Oct 2026 cells outlined

Step 3: Copy It Across the Grid​

Copy B2 and paste it into B2:C4. Each copy picks up its own row's name and column's month. Then add totals with SUM: D2 =SUM(B2:C2) for each person, B5 =SUM(B2:B4) for each month (How to Add Up a Row or Column with SUM in Excel).

Step 4: Check the Totals​

EmployeeOct 2026Nov 2026Total
Aisha Khan16.59.526
Ben Harris15015
Maya Patel11.757.519.25
Total43.251760.25

The Monthly totals sheet showing these totals: Aisha Khan 16.5 and 9.5, Ben Harris 15 and 0, Maya Patel 11.75 and 7.5, with Total rows and columns adding to 43.25, 17 and 60.25

Aisha's October includes a shift she covered in Radiology: the formula totals by person, not by department.

Common Mistakes​

MistakeWhat happensDo this instead
Putting the month dates in as text, like Oct 2026The date conditions compare with text and total 0Put real dates in the headings
$B$1 instead of B$1Every month column totals OctoberFix only the row
Summing Time worked instead of HoursTotals come out as times that wrap at 24 hoursTotal decimal hours

Troubleshooting​

SymptomLikely causeFix
Everyone shows 0Names in column A don't match Employee exactlyCopy the names from the data
A month includes the next month's 1stThe end condition used <=Use "<"&EDATE(B$1,1)
#VALUE!The criteria ranges are different sizesUse whole table columns, as here

FAQ​

Can I total by department instead?​

Yes. Put departments in column A and use OvertimeLog[Department] instead of OvertimeLog[Employee].

Will new rows in the log be counted?​

Yes. OvertimeLog[Hours] and the other table columns grow with the table.

Conclusion​

One SUMIFS with a mixed reference to the name and the month fills a whole grid of totals: hours where the person matches and the date falls in the month.

Additional Resources​