Free workbook practicing 4 methods to build a PivotTable from multiple sheets

Get the Multi-Sheet PivotTable Workbook

Practice all 4 methods from this tutorial: Power Query, Data Model relationships, PIVOTBY + VSTACK, and building a PivotTable with Copilot.

How Do You Combine Multiple Sheets into One PivotTable Using Power Query?

Our first example takes two tables of sales data and appends (or stacks) them into a single table.  This newly stacked table will act as a feeder dataset for a Pivot Table.

The trick is to keep the original tables separate while at the same time not physically creating the feeder table.  We want the appended results to be fed directly to the Pivot Table for reporting.

Two separate Excel sales tables for Store 1 and Store 2 shown side by side before combining into one pivot table

Bringing in the Two Data Sets

The first data set is for Store 1 and appears as follows.

Excel Store 1 sales data table showing Transaction Number in column 1 and Sales Amount in column 5

We see the Transaction Number in the 1st column and the Sales Amount in the 5th column.

The second data set is for Store 2 and appears as follows.

Excel Store 1 sales data table showing Transaction Number in column 1 and Sales Amount in column 5

Notice that the Transaction Number in the 2nd column and the Sales Amount in the 4th column.

This won’t be a problem because our tool of choice will rearrange the data based on column names before sending it to the feeder table.

Meet your new best friend, Power Query

Power Query is a built-in Excel tool used to transform data that would otherwise be unusable into perfectly usable data.

Although not required, Power Query works more efficiently if the source data is in a proper Excel Table format.

To convert our two existing “plain” tables into proper Excel Tables, click anywhere in the first table (Data Store 1) and press CTRL-T on the keyboard.  A Create Table dialog box will appear.  Click OK to select the defaults.

Excel Store 1 sales data table showing Transaction Number in column 1 and Sales Amount in column 5

On the Table Design ribbon, click in the Table Name field (far left side of the ribbon) and rename the table “TableStore1” (no spaces).

Excel Table Design ribbon with the Table Name field showing TableStore1 entered to rename the converted table

Repeat the above process for the second table (Data Store 2) and rename the upgraded table “TableStore2” (no spaces).

Featured Bundle

Power Pro Bundle

10x your productivity in Excel 💪 by mastering Excel’s Power Tools in ONE convenient (cost savings) bundle. Learnings apply to Power BI as well.
Learn More

Using Power Query to “stack” the two data sets

Next, we bring the two tables into Power Query.

Power Query will be used to append (i.e., “stack”) the two tables into a single table.

A great feature of the Append process is that the column’s order in the tables does not need to be identical.  Power Query will automatically rearrange the column order of each table to align into a single table.

Because we need to remember which transactions are sourced to which store, we will add a “helper column” that contains the store’s number next to each related transaction.

Step 1: Bring the first table into Power Query

Click anywhere in the first table (“TableStore1”) and select Data (tab) -> Get & Transform Data (group) -> From Sheet (formerly named “Table/Range”).

Excel Data tab with From Sheet button highlighted in the Get and Transform Data group to load a table into Power Query

A new window will open showing the Power Query Editor.

Power Query Editor open with TableStore1 data showing the Date column containing date-time values before changing type

One small adjustment to this data would be to discard the time information in the “Date” column.

This is easily done by selecting the “Date” column header then click “Data Type: Date/Time” from the Home ribbon and change the data type to “Date”.

Power Query Home ribbon with the Data Type dropdown open changing the Date column from Date/Time to Date only

Click “Replace Current” in the message that follows.  This will update the existing data typing step instead of creating a whole new step for this similar transformation.

Step 2: Add tracking information for each transaction

To not lose focus of which transactions came from which stores, we will add a column to the table that has the store number attached to each transaction.

On the Add Column ribbon, click Custom Column (far left of ribbon).

Power Query Add Column ribbon with the Custom Column button highlighted to add a Store identifier column to the query

In the Custom Column dialog box, give the new column the name “Store” and enter the following formula in the larger formula field.

Power Query Custom Column dialog with column named Store and a formula entering the static text value Store 1

The result is a new column (far right of the table) that displays “Store 1” for each transaction.

Power Query Editor showing the new Store column added to TableStore1 with Store 1 displayed for every transaction row

As with the “Date” column, change the data type for the newly added “Store” column to a TEXT data type.

Power Query Home ribbon with Data Type dropdown changing the Store column type from Any to Text

Step 3: Bring the second table into Power Query

We can save a few steps here by making a copy of the “TableStore1” query and making a few targeted changes.

Featured Course

Master Excel Power Query – Beginner to Pro

Power Query is the most underused tool in Excel. Build the monthly cleanup once, then just refresh. One member took a monthly report from 7 days down to 2 hours.
Learn More
Power Query Course cover

If you click on the SOURCE step in the “Applied Steps” panel (right of editor window) you can see the reference to the “TableStore1” table.

Power Query Applied Steps panel with Source step selected showing the TableStore1 reference in the formula bar

We will make a copy of this query and change the SOURCE step’s pointer from “TableStore1” to “TableStore2”.

In the Queries panel (left of editor window), right-click the “TableStore1” query and select Duplicate.

Power Query Queries panel showing the right-click context menu on TableStore1 with the Duplicate option highlighted

Rename the duplicate query from “TableStore1 (2)” to “TableStore2”.

Power Query Queries panel showing the duplicate query renamed from TableStore1 (2) to TableStore2

Select the SOURCE step in the “Applied Steps” panel.

In the Formula Bar, change the entry from “TableStore1” to “TableStore2” and press ENTER to commit the change.

Power Query formula bar showing the Source step updated from TableStore1 to TableStore2 to redirect the data source

Don’t forget to update the “Added Custom” step at the bottom of the Applied Steps panel to use the label “Store 2” in the “Store” column.

Power Query Applied Steps showing the Added Custom step updated with Store 2 text value in the Store column formula

Step 4: Close the Queries

Because these two queries will ultimately send their results to a 3rd “stacked” query, we will finish their creation process by loading them to Excel.

Because we don’t wish to create actual output tables of these two queries, on the Home ribbon, click the lower part of the “Close & Load” button and select “Close & Load to…”

Power Query Home ribbon with Close and Load dropdown open showing the Close and Load To option to set load destination

In the Import Data dialog box, select the option labeled “Only Create Connection” and click OK.

Excel Import Data dialog with Only Create Connection selected to store the Power Query without outputting to a sheet

You will now see two queries on the right side of the screen in the Queries & Connections panel.

Excel Queries and Connections panel showing TableStore1 and TableStore2 saved as connection-only Power Query queries

Step 5: Append/Stack the Tables into a Single Table

To append the two tables into a single table which will be used to drive the Pivot Table, click Data (tab) -> Get & Transform Data (group) -> Get Data -> Combine Queries -> Append.

Excel Data tab with Get Data menu open showing the Combine Queries submenu and Append option highlighted

In the Append dialog box, select the “Two Tables” option, then select each table from the two supplied dropdown fields.  Click OK when complete.

Power Query Append dialog with Two Tables selected and both TableStore1 and TableStore2 chosen from the dropdowns

Back in the Power Query Editor, you will see a newly created query named “Append1” with the results of the two previous query’s tables stacked to form a single unified table.

Note how we can keep track of which store each transaction came from by using the created “Store” column.

Power Query Editor showing the Append1 query with Store 1 and Store 2 rows stacked and the Store column tracking each source

Step 6: Rename the appended query and output to an Excel Table

Let rename the appended results query to “AllStores”, then click the lower part of the “Close & Load” button and choose “Close & Load…”

In the Import Data dialog box, select Table and New Worksheet as the destination options and click OK.

Excel Import Data dialog with Table and New Worksheet selected to output the AllStores appended query to a new sheet

The result is an Excel Table with the appended results.

Excel Table on a new worksheet showing all Store 1 and Store 2 transactions appended into a single unified table

How Do You Create a PivotTable from the Appended Power Query Data?

To create a Pivot Table from the appended tables, perform one of the following actions:

  • Right-click the “AllStores” query in the Queries & Connections panel (right) and select “Load to…” In the Import Data dialog box, select Pivot Table Report and New Worksheet as the destination options and click OK.
Excel Import Data dialog with PivotTable Report selected to create a pivot table directly from the AllStores query

…or…

  • Click in the table of results and select Insert (tab) -> Tables (group) -> PivotTable.
Excel Insert tab with PivotTable button highlighted in the Tables group as an alternative route to create the pivot table

You can now create a Pivot Table to answer your business-related questions, such as, “What were the total sales by store along with the percentages of total sales?”

Excel pivot table showing total sales by store with percentage of total sales calculated from the appended Power Query data

How Do You Connect Two Excel Tables Using a Data Model Relationship?

In this example, we want to leave the tables in their original structures but connect them in such a way that they “talk” to one another.

Our first table named “TableData” has transactional information.

Excel TableData showing transactional sales data with a ProductCode column containing repeating product codes

Our second table named “TableMaster” has descriptive information about each product in our store catalog.

Excel TableMaster product catalog with one unique row per ProductCode and descriptive fields for department and category

Traditionally, any column in the catalog table that needs to be reported on against the “Data” table (ex: “Total sales by Department”) would need to be brought over from the catalog table to the transaction table using a function like VLOOKUP or a formula that used INDEX & MATCH.

This would create a single, large table.

What we will do is connect these two tables using what is known as a Relationship.

What is a Relationship?

A Relationship is where you select a column from each table that has identical information.

Featured Course

Excel Data Modeling with Power Pivot & DAX

For Excel users whose data is spread over more than one table. Connect them properly, handle millions of rows, write the calculations pivot tables can’t. Same skills run Power BI.
Learn More
Power Pivot DAX course cover

For example, we have a “ProductCode” column in the “TableData” table.  This lists the item sold.

We are likely to see many repeats of the same product codes as we hope to sell many of the same items throughout the reporting period.

Excel TableData with ProductCode column highlighted showing repeating product codes as the many side of the relationship

In the “TableMaster” table, we have an entry for each of the product codes along with descriptive information about each product.

The catalog of products should only have one entry for each product.

Excel TableMaster with ProductCode column highlighted showing unique product codes as the one side of the relationship

Connecting the Tables (i.e., creating the Relationship)

To connect the two tables by way of the ProductCode column, perform the following steps:

  1. Select Data (tab) -> Data Tools (group) -> Relationships.
Excel Data tab with the Relationships button highlighted in the Data Tools group to manage table relationships
  1. In the Manage Relationships dialog box, click “New…”
Excel Manage Relationships dialog open with the New button highlighted to begin creating a relationship between two tables
  1. In the Create Relationship dialog box, select the two tables using the left-side dropdowns and the “ProductCode” column using both right-side dropdowns. Click OK when finished.
Excel Create Relationship dialog with TableData and TableMaster linked via the ProductCode column in both dropdown fields

You now have a connection between each table that serves as a live communications path between the tables.

Excel Manage Relationships dialog showing the active relationship between TableData and TableMaster on ProductCode

Click the “Close” button to close the Manage Relationships dialog box.

This relationship adds the two related tables to what is known as the Data Model.  Think of it as a back-end database of all related tables.

Excel Data Model diagram showing TableData and TableMaster connected as related tables after creating the relationship

Featured Course

Excel Essentials for the Real World

A hands-on Excel course for professionals who never had formal training. Fill in what got skipped, so you stop doing things the long way without knowing there was a shorter one.
Learn More

To create a Pivot Table from the two related tables, select Insert (tab) -> Tables (group) -> Pivot Table (dropdown arrow) -> From Data Model.

Excel Insert tab PivotTable dropdown showing the From Data Model option to create a pivot table from related tables

Place the Pivot Table on a new sheet.

Excel PivotTable from Data Model dialog with New Worksheet selected as the destination for the pivot table

Populate the Pivot Table as needed to answer the applicable business questions.

Excel pivot table built from the Data Model showing fields from both TableData and TableMaster in the PivotTable Fields List

Should You Use Power Query Append or Data Model Relationships?

Neither one of these approaches is better than the other when discussing technique.  However, each approach brings to the table a series of pros and cons.

Selecting the “correct” approach depends on how the data is structured, what you want to create, your comfort level with Power Query and/or Relationships.

It’s up to you to decide the method you prefer when dealing with your data.

Knowing and becoming proficient in both methods will serve you well in the long run.

How Can You Use PIVOTBY and VSTACK to Summarize Multiple Sheets Without a PivotTable?

The PIVOTBY function combined with VSTACK lets you summarize data from multiple sheets in a single formula, without creating a PivotTable at all. PIVOTBY groups your data along rows and columns and aggregates values (sums, averages, counts), while VSTACK stacks the ranges from different sheets into one vertical array. The result is a fully dynamic summary that updates instantly when source data changes. No refresh button needed.

PIVOTBY is available in Excel for Microsoft 365 (Windows and Mac), Excel 2024 (Windows and Mac), and Excel 2021 (Windows and Mac). VSTACK is available in Excel for Microsoft 365 and Excel for the web. Both functions require dynamic array support.

Note: PIVOTBY produces output that looks similar to a PivotTable, but it is a formula, not a PivotTable feature. You cannot add slicers, drill down into rows, or use PivotChart with it.

How the Formula Works

Suppose you have two sheets, Store1 and Store2, each with sales data in the same column layout: Product in column A, Region in column B, and Amount in column C. You want a summary of total sales by Product (rows) and Region (columns) across both stores.

Enter this formula in a blank cell on a new sheet:

=PIVOTBY( VSTACK(Store1!A2:A100, Store2!A2:A100), VSTACK(Store1!B2:B100, Store2!B2:B100), VSTACK(Store1!C2:C100, Store2!C2:C100), SUM )

Here is what each part does:

  • VSTACK(Store1!A2:A100, Store2!A2:A100) stacks the Product column from both sheets into a single array. This becomes the row_fields argument.
  • VSTACK(Store1!B2:B100, Store2!B2:B100) stacks the Region column. This becomes the col_fields argument.
  • VSTACK(Store1!C2:C100, Store2!C2:C100) stacks the Amount column. This is the values argument.
  • SUM is the aggregation function. You can also use AVERAGE, COUNT, MAX, MIN, or a custom LAMBDA.

The formula spills a complete summary grid into the surrounding cells. If you add data to either sheet, the results update automatically.

When to Use PIVOTBY + VSTACK Instead of a PivotTable

This approach works best when you want a quick, formula-based summary that stays embedded in your worksheet, updates without refreshing, and does not need interactive features like slicers, timelines, or drill-down.

Traditional PivotTables are still the better choice when you need drag-and-drop field rearrangement, expandable hierarchies, PivotCharts, or when colleagues who don’t have Microsoft 365 or Excel 2024 need to open the file.

For a deeper look at the VSTACK function, see this tutorial on VSTACK.

How Can Copilot in Excel Build a PivotTable from Multiple Sheets?

If you have a Microsoft 365 subscription with Copilot access, you can ask Copilot to create a PivotTable from multiple sheets using plain language. Instead of navigating ribbon menus and dialog boxes, you type a prompt describing the summary you want, and Copilot handles the table setup, field placement, and output.

This feature is called Edit with Copilot. Microsoft previously marketed it as “Agent Mode,” but as of early 2026 the branding has been simplified. The editing capability is now the default behavior when you open the Copilot pane in Excel.

What You Need Before Starting

Subscription: Edit with Copilot requires a Microsoft 365 Personal, Family, or Premium subscription (with AI credits), a commercial Microsoft 365 Copilot subscription, or a Copilot Chat-eligible business/enterprise plan.

File format: Your workbook must be an .xlsx file saved to OneDrive or SharePoint. AutoSave must be turned on in the desktop app.

Data format: Each sheet’s data should be formatted as an Excel Table (select any cell in the range and press CTRL+T). Copilot works better with properly structured tables that have clear column headers and no blank rows.

How to Use Copilot to Create the PivotTable

  • Step 1: Open your workbook in Excel for the web or the Microsoft 365 desktop app.
  • Step 2: Select Home > Copilot to open the Copilot pane on the right side of the screen.
  • Step 3: When the pane opens, editing is on by default. You will see the Excel selector in the chat box, which confirms Copilot can make changes to your workbook.
  • Step 4: Type a prompt that describes what you want. Be specific about which data and which summary. For example:
"Create a PivotTable that summarizes total sales by product and store, using the data tables on the Store1 and Store2 sheets. Place it on a new sheet."
  • Step 5: Copilot will analyze your data, build a step-by-step plan in the pane, and make changes directly in your workbook. You can watch the reasoning in real time. For complex requests, this may take a few minutes.
  • Step 6: Review the result. If the PivotTable needs adjustments, type a follow-up prompt like “Add a slicer for Region” or “Change the aggregation to AVERAGE.”

You stay in control of every change. Use Ctrl+Z to undo any step, or access version history to revert to an earlier state.

When to Use Copilot vs. Manual Methods

Copilot is fastest when you know what summary you want but don’t want to set up the mechanics yourself. It is especially useful for multi-step tasks like reshaping data across sheets and building a report with charts and PivotTables in one pass.

Use the manual methods covered earlier in this tutorial (Power Query or Data Model Relationships) when you need full control over each transformation step, when you are working offline, or when your organization does not have Copilot access.

Download the Practice Workbook

Practice all 4 methods from this tutorial with the exact workbook from the video.

Leila Gharani

Founder of XelPlus and ten-time Microsoft MVP. Leila helps over 500,000 professionals master Excel, Power BI, and data automation through practical, real-world training.