Function Problems

How to Sum Staff Hours by Milestone and Week in Excel

Bushra ParveenBushra Parveen Nov 10, 2026 869 views

Question details

The user needs to calculate and aggregate staff hours conditionally, summing the hours only when a specific milestone is scheduled during a selected week for a designated staff member.

How to Sum Staff Hours by Milestone and Week in Excel
Product
Excel
Device & OS
not provided
Scenario
Tracking project management data where milestones are mapped by week, hours are assigned by staff member, and a combined output table needs to show total hours per staff member per week.
Observed behavior
The user needs a dynamic output table that accurately calculates the staff-by-week aggregated hours by cross-referencing multiple data matrices.
Before you start

Ensure your workbook data is neatly organized into specific ranges: one area for the milestone schedule (marked by week) and another for staff assignments mapping milestone hours.

Solution 1Recommended

Use a Matrix Calculation Combining SUMPRODUCT and XLOOKUP

Use SUMPRODUCT to evaluate multiple condition arrays and multiply the result by the target staff member's hours retrieved via XLOOKUP.

This solution works by multiplying boolean arrays (True/False represented as 1/0) against an array of staff hours. When all conditions are met—the week matches, the milestone exists, and the schedule is marked—the formula returns the required hours.

1
Organize your data tabs

Make sure your milestone schedule is on 'Tab A' (milestones in column A, week headers in row 1, 'X' for scheduled). Place your staff hours on 'Tab B' (staff names in column A, corresponding milestone hours in columns B through Z).

2
Input the array formula

In your final output table where you want the summed hours, enter the following formula: =SUMPRODUCT((TabA!$B$1:$Z$1=B$1)*(TabA!$A$2:$A$100<>"")*(TabA!$B$2:$Z$100="X")*XLOOKUP($A2,TabB!$A$2:$A$100,TabB!$B$2:$Z$100,0))

3
Adjust cell references

Modify the sheet names (TabA, TabB) and the specific range addresses (like $A$2:$A$100) to perfectly match the dimensions of your actual workbook data. Ensure absolute references ($) are used so you can drag the formula across the rest of the table.

Use a Matrix Calculation Combining SUMPRODUCT and XLOOKUP
Formula Breakdown: The condition (TabA!$B$2:$Z$100="X") acts as a filter. It ensures hours are only added to the sum if that specific milestone is scheduled with an 'X' in the selected week.
Advanced Project Tracking

Calculate Complex Project Data Easily in WPS Spreadsheet

WPS Spreadsheet fully supports advanced array formulas like SUMPRODUCT and XLOOKUP, allowing you to seamlessly manage project milestones and staff hours across massive data sets.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open your project management file containing the milestone and staff tables.
  2. 2. Select the target cell: Click on the first cell of your final staff-by-week output table.
  3. 3. Apply the formula: Paste your combined SUMPRODUCT and XLOOKUP matrix formula into the formula bar and press Enter.
  4. 4. Fill the table: Drag the fill handle across the rows and columns to automatically calculate the hours for all staff members and weeks.
Fully compatible with Microsoft Excel (.xlsx) formats, ensuring your formulas work without modification.High calculation performance for processing large matrix models and project schedules.Completely free and lightweight with an intuitive, familiar user interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my SUMPRODUCT formula return a #VALUE! error?

A #VALUE! error in SUMPRODUCT usually occurs when the array ranges provided in the formula are not exactly the same size. Double-check that all ranges (e.g., $A$2:$A$100 and $B$2:$Z$100) encompass the exact same number of rows and columns as intended.

Can I use INDEX and MATCH instead of XLOOKUP?

Yes. If you are using an older version of Excel that does not support the XLOOKUP function, you can replace the XLOOKUP portion of the formula with an INDEX/MATCH combination to retrieve the array of staff hours.

How can I calculate partial hours instead of using an 'X' for scheduling?

Instead of marking scheduled weeks with an 'X', you can input decimal percentages (like 0.5 for half a week) directly into the milestone matrix. Update the formula to multiply by the cell's actual value instead of checking for the text 'X'.