search
HomeTopicsexcelExcel case sharing: Use Powerquery to merge multiple sheets with one click

Excel case sharing: Use Powerquery to merge multiple sheets with one click

After sharing Power Query merging worksheets with you last time, many friends left messages asking what should be done if there is an increase or decrease in worksheets? Today I will introduce to you how to use Power Query to merge workbooks, so that no matter the worksheet changes or data changes in the workbook, you can refresh the summary with one click. Come and learn now!

Those who did not learn the last tutorial should learn the previous one first. Click to view: "Excel Case Sharing: Using Power Query to Implement Multi-Table Merger"

As shown in the figure, there are four worksheets under the workbook, which list the sales data of four cities respectively.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

First create a new workbook, open the [Acquisition and Conversion] group under the Data tab, click New Query---From File---From Workbook.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

In the import data window, find the location of the workbook, select the workbook, and click Import.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

Check "Multiple Select" in the navigator window and check the four worksheets below.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

You can also directly select the workbook (the 4 at the end indicates that the workbook has four worksheets) and click Edit.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

This will enter the Power Query editor interface introduced before. The top is the menu bar, the middle is the table area and the data that will be returned to the worksheet at the end. The query setting window on the right displays the Power Query operation record.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

The table area displayed in the middle displays the information of the data source workbook. The "Name" column is the name of the worksheet contained in the workbook, where "Data" This column is in green font, which means that each cell contains a Table. Click the cell to preview the content inside (note: when the mouse is placed on the text and turns into a palm shape, the file in the cell is opened to generate a new step. If you need to preview, just click elsewhere in the cell. ). The content of this Table appears in the preview pane below, which is the data we want to summarize.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

#What we need to do now is to extract and merge all the Tables in the "Data" column.

Click the expand button in the upper right corner of Data and select to expand all columns in the drop-down window. This "Use original column name as prefix" is generally not checked, click OK.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

#In this way, all the contents of the worksheets in the workbook are summarized in the table. A new step appears in the query settings window on the right. When you click the cross in front of a step, the step is deleted and returns to the previous step. This is the step recorder of Power Query. When we make a mistake in a certain step and need to go back, we can select any of the above steps to view the results of that step, or delete a new step.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

Next delete other unnecessary columns. Hold down Ctrl to select the column you want to delete, and click "Delete Column" in the [Manage Columns] group under the Home tab.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

To change the new column name to the original column name, you can directly use the first row of fields as the column name. Click "Use first row as title" in the [Conversion] group under the Home tab.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

Since the merged worksheets have multiple titles, filter out the duplicate titles. Click the filter button on the upper right side of the salesperson column and check off "Salesperson".

1Excel case sharing: Use Powerquery to merge multiple sheets with one click

This completes what we want to do. Click "Close and Upload" in the [Close] group under the Home tab.

1Excel case sharing: Use Powerquery to merge multiple sheets with one click

Close and upload means uploading all the queries made in Power Query to each worksheet. If there is only one query, you can use this method.

Close and upload to a pop-up window for everyone to choose whether to upload to the table or create a connection. The created connection can be directly used to generate pivot tables, etc., which will be introduced to you later.

In this way, the content in Power Query will be uploaded directly to the table. In order to facilitate summary, we insert the organized data into the pivot table.

1Excel case sharing: Use Powerquery to merge multiple sheets with one click

This summary query is completed. Let's try adding a worksheet to the data source workbook. The field names inside are consistent with other worksheets. Click Save.

1Excel case sharing: Use Powerquery to merge multiple sheets with one click

#Then click "Refresh All" in the [Connection] group under the Data tab in the summary table.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

The new worksheet will be added.

1Excel case sharing: Use Powerquery to merge multiple sheets with one click

Similarly, when the work table is reduced or the data changes, it can be completed in this way. In this way, you can easily summarize the data in the workbook.

Sometimes we may have a lot of source data, and the response of uploading all the data to the table will be slow. In that case, we can directly use the connection to generate a pivot table for analysis.

What appears in the workbook query window on the right side of the worksheet is the query we have made. Select the query, right-click and select "Load to".

1Excel case sharing: Use Powerquery to merge multiple sheets with one click

If you do not have this workbook query window, you can click "Show Query" in the [Get and Convert] group of the Data tab.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

In the "Load to" window, select "Only create a connection" and click Load.

Excel case sharing: Use Powerquery to merge multiple sheets with one click

The query completed in this way is stored in the workbook in the form of a connection. Then click "PivotTable" in the [Table] group under the Insert tab.

2Excel case sharing: Use Powerquery to merge multiple sheets with one click

Before creating a Pivot Table, you always select the first table or range. We select the second "Use external data source" and click "Select Connection".

2Excel case sharing: Use Powerquery to merge multiple sheets with one click

In the existing connection window, you can see the connection we just created, select it and click to open, and then confirm to insert the pivot table.

2Excel case sharing: Use Powerquery to merge multiple sheets with one click

In this way, you can see the pivot table generated based on this connection, which is the same as the pivot table we just created using the table.

2Excel case sharing: Use Powerquery to merge multiple sheets with one click

On the one hand, this method can avoid excessive EXCEL data causing the file to be too large. On the other hand, if data summary is required, it can also reduce the step of loading into the table.

Related learning recommendations: excel tutorial

The above is the detailed content of Excel case sharing: Use Powerquery to merge multiple sheets with one click. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:部落窝教育. If there is any infringement, please contact admin@php.cn delete
MEDIAN formula in Excel - practical examplesMEDIAN formula in Excel - practical examplesApr 11, 2025 pm 12:08 PM

This tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden

Google Spreadsheet COUNTIF function with formula examplesGoogle Spreadsheet COUNTIF function with formula examplesApr 11, 2025 pm 12:03 PM

Master Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han

Excel shared workbook: How to share Excel file for multiple usersExcel shared workbook: How to share Excel file for multiple usersApr 11, 2025 am 11:58 AM

This tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m

How to convert Excel to JPG - save .xls or .xlsx as image fileHow to convert Excel to JPG - save .xls or .xlsx as image fileApr 11, 2025 am 11:31 AM

This tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo

Excel names and named ranges: how to define and use in formulasExcel names and named ranges: how to define and use in formulasApr 11, 2025 am 11:13 AM

This tutorial clarifies the function of Excel names and demonstrates how to define names for cells, ranges, constants, or formulas. It also covers editing, filtering, and deleting defined names. Excel names, while incredibly useful, are often overlo

Standard deviation Excel: functions and formula examplesStandard deviation Excel: functions and formula examplesApr 11, 2025 am 11:01 AM

This tutorial clarifies the distinction between standard deviation and standard error of the mean, guiding you on the optimal Excel functions for standard deviation calculations. In descriptive statistics, the mean and standard deviation are intrinsi

Square root in Excel: SQRT function and other waysSquare root in Excel: SQRT function and other waysApr 11, 2025 am 10:34 AM

This Excel tutorial demonstrates how to calculate square roots and nth roots. Finding the square root is a common mathematical operation, and Excel offers several methods. Methods for Calculating Square Roots in Excel: Using the SQRT Function: The

Google Sheets basics: Learn how to work with Google SpreadsheetsGoogle Sheets basics: Learn how to work with Google SpreadsheetsApr 11, 2025 am 10:23 AM

Unlock the Power of Google Sheets: A Beginner's Guide This tutorial introduces the fundamentals of Google Sheets, a powerful and versatile alternative to MS Excel. Learn how to effortlessly manage spreadsheets, leverage key features, and collaborate

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment