How to Calculate Weekly Employee Hours Across Multiple Excel Columns
Question details
The user needs a method to total all weekly hours assigned to specific employees when their names and corresponding hours are distributed across multiple columns in a two-dimensional schedule.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating weekly schedule hours for payroll or time tracking when the schedule layout spans multiple days and columns.
- Observed behavior
- Using standard functions like SUMIF may fail because the criteria range spans multiple columns, which creates a mismatch in shape with the sum range. A formula capable of handling two-dimensional array conditions is required.
Ensure that employee names are spelled exactly the same across all columns in your schedule, and verify that all assigned hours are entered as numeric values rather than text.
Use the SUMPRODUCT Function for Two-Dimensional Ranges
SUMPRODUCT is the most reliable method for searching a full schedule grid and summing corresponding hours because it naturally handles two-dimensional arrays.
When your employee names and their corresponding hours are listed across multiple columns (e.g., Monday to Friday columns), SUMIF cannot handle the mismatched array shapes. SUMPRODUCT multiplies the arrays conditionally to return the correct total.
Click on the cell where you want to display the employee's total weekly hours.
Type the formula =SUMPRODUCT((A2:E10="Employee Name")*(B2:F10)), replacing "Employee Name" with the actual name, A2:E10 with your schedule's name grid, and B2:F10 with the corresponding hours grid.
Press Enter to calculate the sum. Ensure the name range and hours range are identically sized but properly offset to match your specific column layout.

Restructure the Schedule Data to Use SUMIF
If you prefer using SUMIF and do not want to manage offset arrays, you must first reorganize your 2D schedule into a standard 1D tabular format.
Easily Calculate Schedule Hours with WPS Spreadsheet
WPS Spreadsheet fully supports advanced array functions like SUMPRODUCT, making it easy to calculate complex 2D schedule data without restructuring your tables.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your weekly schedule workbook.
- 2. Enter the SUMPRODUCT formula: Click on the total hours cell and input your SUMPRODUCT formula referencing the multiple name and hour columns.
- 3. Apply and calculate: Press Enter to get the result, and use the fill handle to drag the formula down to calculate hours for other employees dynamically.

Frequently Asked Questions
Why doesn't SUMIF work for summing across multiple columns?
SUMIF requires the criteria range and sum range to be the exact same size and shape. If you select a two-dimensional criteria range (like multiple days) but a one-dimensional sum range, it cannot map the values correctly and will return incorrect results or an error.
How do I handle empty cells or text in the hours range when using SUMPRODUCT?
If your hours range contains text, the default SUMPRODUCT multiplication will cause a #VALUE! error. Ensure all cells in the sum range are either blank or contain numeric values. Alternatively, you can modify the formula using double negatives, such as =SUMPRODUCT(--(NameRange="John"), HoursRange), if your ranges align perfectly without an offset.
Can I calculate weekly hours for multiple employees at once?
Yes. Instead of typing the employee's name in quotes directly into the formula, reference a cell containing the employee's name (e.g., =SUMPRODUCT(($A$2:$E$10=H2)*($B$2:$F$10))). You can then drag the formula down a list of unique employee names to calculate all totals simultaneously.




