Introduction
Hello! Welcome back to our module on Advanced Data Consolidation.
In our last lesson, you learned how to use Power Query to automatically combine data from multiple Excel files located in a single folder. This is a massive time-saver for any MIS role. Today, we'll tackle a closely related and equally common scenario: consolidating data that's spread across multiple worksheets within a single Excel workbook.
Think of a workbook with separate tabs for sales from January, February, and March, or incident logs for Q1, Q2, and Q3. Manually copying and pasting this data into a master sheet is tedious and error-prone. With Power Query, you can build a dynamic, refreshable master table in minutes.
Our learning goal for this lesson is to append data from multiple worksheets into a single master table. We will explore two powerful methods to achieve this, giving you the flexibility to handle different data consolidation tasks you'll encounter as an MIS Executive.
1. The Crucial First Step: Excel Tables
Just like when we combined separate files, Power Query works best when your data is structured. Before we can append data from multiple sheets, we must first ensure the data on each sheet is formatted as a named Excel Table.
This is not an optional step. Power Query needs these formal table structures to identify and process the data ranges on each sheet automatically.
The process is simple:
- Click anywhere within your data range on a worksheet.
- Go to the Insert tab and click Table, or use the shortcut Ctrl + T.
- Ensure Excel has correctly identified your data range and that the "My table has headers" box is checked (if applicable).
- After creating the table, go to the Table Design tab, and in the Table Name box on the far left, give your table a descriptive name (e.g.,
Jan_Sales,Q1_Incidents). This is a best practice that makes your queries much easier to manage.
2. Method 1: The Dynamic Approach with Excel.CurrentWorkbook()
Our first method is the most efficient and scalable. It uses a single Power Query function to find all the tables in your current workbook and combine them automatically. This method is particularly powerful because it will automatically include any new worksheets (that you convert to tables) when you refresh it later.
Let's watch a video that walks through this entire process.
Combine Multiple Worksheets Into One Worksheet in Excel Using Append Query
This video from Chester Tugwell demonstrates the Excel.CurrentWorkbook() method from start to finish. It covers converting data to tables, using the function, cleaning the combined data, and solving a very important problem related to refreshing.
Please watch the video in the following segments: Prepare the Data (00:46 - 02:03): Watch how the raw data on each sheet is converted into a named Excel Table. This is the foundational step we just discussed. Combine the Tables (02:03 - 03:52): Pay close attention to how a 'Blank Query' is created and the =Excel.CurrentWorkbook() formula is used. You'll see how this one line of code lists all the tables, which can then be 'expanded' to combine their data. Clean the Combined Data (03:52 - 06:14): The video now walks through common cleaning steps in the Power Query Editor, such as removing unwanted columns, promoting headers, and setting data types. We will cover these transformations in more detail in our next lesson, but it's good to see them in context here. Load, Refresh, and Solve the Recursion Problem (06:14 - 10:13): This is the most critical part. The video first shows how to load the data back to Excel. Then, it explains that refreshing the query will cause data to be duplicated. It demonstrates the essential fix: filtering the list of tables to exclude the final output table itself. This ensures the query doesn't try to append its own results back into the source.
Understanding the Recursion Problem
The "recursion" issue highlighted at the end of the video is a common pitfall. To make it crystal clear, let's review the excellent explanation from the Trump Excel website.
Combine Data From Multiple Worksheets - Trump Excel
This article provides a concise text-based explanation of why the data duplicates upon refresh and how to solve it by filtering your query.
Please read the section titled "One Issue You Must Resolve when Using This Method". It starts right after the steps for loading the data into Excel. Focus on understanding why the problem occurs: the query that creates the combined table is itself a table in the workbook, so it gets re-added every time you refresh. The solution is to filter the source step so that the query ignores its own output table.
3. Method 2: The Explicit Approach with "Append Queries"
There is another way to combine worksheets, which is more manual but gives you more explicit control. This method involves:
- Creating a separate query for each worksheet table, loading them as "connection only."
- Using the Append Queries command to stack these connections into a new, combined query.
This method is useful if you need to perform different cleaning steps on each table before combining them, or if you want to add identifying information (like a "Region" or "Month" column) to each table first.

Let's watch a video demonstrating this approach.
09 - Combine Excel Tables in the Same Workbooks Using Power Query (Append Method)
This video from TrumpExcel clearly shows the 'connection-only' and 'Append' workflow. Notice the excellent practice of adding a custom column to identify the data's source before appending.
Watch from the beginning until (06:08). (01:03 - 05:12): See how a query is created for each worksheet table. Crucially, notice the addition of a 'Custom Column' (e.g., 'Region') to tag the data. The queries are then loaded as 'Connection Only', so they don't create extra tables in the workbook. (05:12 - 06:08): This part shows how to use the 'Append Queries' command to select the connection-only queries and combine them into one master query.
While this method works perfectly well, for most standard consolidation tasks where the sheet structures are identical, the Excel.CurrentWorkbook() method is faster and more scalable.
4. Your Turn: Consolidate Quarterly Incident Reports
Now, let's apply what you've learned to a scenario from your cybersecurity background. You have an Excel file where incident data is logged on separate worksheets for each quarter. Your task is to create a consolidated master incident log.
We will use the more dynamic Method 1 (Excel.CurrentWorkbook()) for this exercise.
1. Create Your Sample Data:
- Open a new, blank Excel workbook and save it as
Master Incident Log.xlsx. - Rename
Sheet1toQ1_Incidents. Create two more sheets namedQ2_IncidentsandQ3_Incidents. - On the
Q1_Incidentssheet, enter the following data:
| Incident ID | Date Reported | Priority | Status |
|---|---|---|---|
| INC-001 | 2023-01-15 | High | Closed |
| INC-002 | 2023-02-20 | Medium | Closed |
| INC-003 | 2023-03-10 | High | Open |
- Copy this table and paste it onto the
Q2_IncidentsandQ3_Incidentssheets. Change the dates and Incident IDs slightly for each quarter to simulate new data.
2. Format as Excel Tables:
- For each of the three worksheets (
Q1,Q2,Q3):- Click inside the data.
- Press Ctrl + T.
- In the Table Design tab, name the tables
Q1_Data,Q2_Data, andQ3_Datarespectively.
3. Combine with Power Query:
- Go to Data > Get Data > From Other Sources > Blank Query.
- In the Power Query Editor's formula bar, type
=Excel.CurrentWorkbook()and press Enter. - You will see a list of the three tables you created.
- Click the expand icon (the two arrows) on the
Contentcolumn header. Uncheck "Use original column name as prefix" and click OK. Your data is now combined!
4. Prevent the Recursion Error:
- Before we load the data, we must apply the filter to prevent future errors.
- In the Applied Steps pane on the right, click on the very first step, named Source.
- The query will now show the list of tables again. Let's rename our query first. In the Query Settings pane, change the Name from
Query1toMaster_Log. - Now, click the filter arrow on the
Namecolumn header. Go to Text Filters > Does Not Equal. - In the dialog box, type
Master_Log(the name of your query). Click OK. - Click on the last applied step in the list (likely "Changed Type") to see your final combined data again.
5. Load and Test:
- Click Close & Load in the top-left corner. A new sheet will be created with your
Master_Logtable. - Now, test the automation:
- Create a new sheet named
Q4_Incidents. - Add some new incident data and format it as a table named
Q4_Data. - Go back to the
Master_Logsheet, right-click inside your combined table, and select Refresh. - The Q4 data should appear instantly at the bottom of the table.
- Create a new sheet named
You have successfully built an automated system for consolidating data from multiple worksheets!
Conclusion
Great work! You've just added another essential Power Query skill to your toolkit. Consolidating data is a fundamental task for any MIS role, and knowing how to automate it sets you apart.
Key Takeaways:
- Excel Tables are essential. Power Query needs data to be in a named Excel Table to append it from multiple sheets.
- The
=Excel.CurrentWorkbook()function is a fast, dynamic way to combine all tables within a workbook. - When using this method, you must filter out the final query's name from the source step to prevent recursion errors that duplicate your data upon refresh.
- The Append Queries command offers a more manual alternative, useful for creating "connection-only" queries or when you need more granular control before combining.
In our next lesson, we'll dive deeper into the Power Query Editor itself. Now that you know how to bring data in from multiple files and multiple sheets, we'll focus on applying basic data transformations like filtering rows, removing columns, and changing data types to clean and prepare your data for analysis.