Combine Monthly Excel Data and Sum Hours by ID with Power Query
Question details
Combine monthly reports with varying IDs and calculate maintenance team hours for each ID.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- Monthly worksheets or files contain maintenance hours for different IDs and need to feed a consolidated totals sheet.
- Observed behavior
- The desired summary includes every ID from the combined reports and sums hours for each maintenance team.
Check that each monthly report identifies the ID and team-hour columns, and decide how to record the month. Use consistent ID formatting and numeric hour values across reports.
Append monthly reports in Power Query and summarize hours in a PivotTable
Use this approach to build a refreshable source that includes IDs from all imported monthly reports.
On each worksheet, select the report data and choose Insert > Table. Make sure each table has consistent headers, such as ID, Team A hours, and Team B hours.
Select each table and choose Data > From Table/Range. In Power Query, rename columns as needed, set consistent data types, and add a Month column through Add Column if the source does not already have one.
In Power Query, choose Home > Append Queries > Append Queries as New. Select the monthly queries, confirm the combined rows and columns, and choose Home > Close & Load to load the result as a table.
Select the combined table and choose Insert > PivotTable. Place ID in Rows and Team A hours and Team B hours in Values, setting each value field to Sum if necessary.
Choose Data > Refresh All after existing source data changes. For a new monthly worksheet, import it as another query, open the combined query from Data > Queries & Connections, and use Home > Append Queries to add the new query before refreshing.

Combine monthly hours by ID in WPS Spreadsheets
Use WPS Spreadsheets to consolidate monthly rows manually and summarize team hours in a PivotTable. This provides the totals without using Excel Power Query.
- 1. Open the reports: Open the monthly Excel files in WPS Spreadsheets and check that their ID and team-hour columns use matching headers.
- 2. Combine the rows: Create a worksheet with Month, ID, Team A hours, and Team B hours as headers. Copy and paste each month's data beneath those headers, adding the month to each row.
- 3. Insert a PivotTable: Select the combined data range and choose Insert > PivotTable. Place ID in Rows and both team-hour fields in Values, using Sum for each field.
- 4. Update the summary: When another month is available, paste its rows into the combined sheet. Update the PivotTable's data source to include the new rows if needed, then refresh the PivotTable.

Frequently Asked Questions
How do I include IDs that appear in only one month?
Append all monthly queries before creating the PivotTable. Put ID in the Rows area so the summary can list IDs from any of the combined reports.
Why are team hours being counted instead of summed?
Check that the hour columns contain numbers and have a numeric data type in Power Query. In the PivotTable, open Value Field Settings for each hour field and select Sum.
Will Refresh All automatically include a new monthly worksheet?
Not if the combined query references only the existing monthly queries. Import the new worksheet as a query and append it to the combined query, then select Data > Refresh All.
How can I keep leading zeros in IDs?
Format IDs consistently as text in the source and set the ID column to Text in Power Query. If leading zeros were already removed from the source values, restore them before combining the reports.




