To create a PivotTable from multiple tables located on different sheets in Excel, you can use the following methods:
- Using Power Query: Although you mentioned that Power Query does not allow you to keep the PivotTable in the same worksheet, it is still a powerful tool for consolidating data from multiple sheets. You can load the consolidated data into a new worksheet and then create a PivotTable from that data. Here’s how:
- Go to the Data tab and select Get Data > From Other Sources > Blank Query.
- Use the Advanced Editor to combine your data from different sheets into one table.
- Load the combined data into a new worksheet.
- Create your PivotTable from this new data.
- Using the Data Model: If you have Excel 2013 or later, you can use the Data Model feature to create relationships between tables from different sheets. Here’s how:
- Load each of your monthly tables into the Data Model by selecting them and choosing Add to Data Model when creating a PivotTable.
- Once all tables are added, you can create relationships between them based on common fields.
- Create a PivotTable from the Data Model, which allows you to summarize data from multiple tables.
- Using Consolidate Feature: You can also use the Consolidate feature in Excel:
- Go to the Data tab and select Consolidate.
- Choose the function you want to use (e.g., Sum, Count) and select the ranges from each sheet.
- This will create a summary table that you can then use to create a PivotTable.
If you encounter an error stating that the source is not valid, ensure that the ranges you are selecting are correctly defined and that there are no blank rows or columns in your data.
References: