How to Combine Data from Multiple Sheets in one File?
Last Updated :
03 Mar, 2022
Merging data into a single sheet is a crucial and significant skill to know. For example, you have the monthly sales of a company in the 12 worksheets of excel. Now you want to calculate the net revenue made in the entire year. So, we need to merge all the data in the 12 excel sheets, this task could be easily achieved by power query in excel. Let's learn how to merge data from all sheets in a selected file using a power query.
Power Query
Power Query is one of the very powerful tools in excel. Some important points of power query are:
- Power query can save more than 50% of your time.
- Power query comes with triple power. It has functionalities of Advance Excel, SQL, and VBA.
- VLOOKUP function can be used in just a few mouse clicks.
- If you are using an excel version greater than 2016 then you will get a built-in power query. For versions older than this, the power query needs to be added separately.
Power query is already built-in in excel. Go to Data Tab, Get & Transform Data, and Queries & Connections section is the power query for users having the 2019 excel version.

Merging data from all sheets in a file
The best way to understand merging sheets in a file is by an example, given a data set of three worksheets sheet1, sheet2, and sheet3. Each sheet contains a table name mid_sem_1, mid_sem_2 and end_sem respectively. The table in sheet1 has columns as Roll No. , Name, and Mid Sem 1 marks. The table in sheet2 has columns as Roll No., Mid Sem 2 marks. The table in sheet3 has columns as Name and End Sem marks. The name of this workbook is geeks_for_geeks.xlsx.


Following are the steps to merge all the sheets in the selected file:
Step 1: Press Ctrl + N to create a new file. Go to the Data tab, and click on Get Data.
Step 2: Go to From File and click on From Workbook.
Step 3: Open file geeks_for_geeks.xlsx. A navigator dialogue box appears.
Step 4: Select the tables you want to transform and merge data from different excel sheets.
Step 5: A power query editor appears. Go to the mid_sem_1 table.
Step 6: In the home tab, click on Merge Queries. A dialogue-box name Merge appears.
Step 7: Select the table you want to merge with mid_sem_1. For example, mid_sem_2.
Step 8: Select the column that is common in both tables. For example, Roll No. is the attribute that is common in both tables. Click Ok.
Step 9: A new column in table mid_sem_1 is added. The name of the attribute is mid_sem_2.
Step 10: Click on the double-sided arrow and select the columns you want to add to this table. Uncheck the box Use the original column name as a prefix to have the original column names in your table.
Step 11: The mid sem 2 marks get appended in your table name mid_sem_1.
Step 12: Repeat step 6. Go to the home tab and click on Merge Queries. A Merge dialogue box appears. Select the table name end_sem. Now, select the column which is common in the mid_sem_1 and end_sem table. Click Ok.
Step 13: A column name end_sem appears in mid_sem_1 table. Click on the double-sided arrow. Select the column you want to add to the merged table. For example, End sem marks. Uncheck the box Use the original column name as a prefix. Click Ok.
Step 14: A new column name End sem Marks is appended in the table name mid_sem_1.
Step 15: Sort the Roll No. in ascending order.
Step 16: The table is ready. In the home tab, click on Close & Load.
Step 17: The merged table is created in sheet name mid_sem_1. We can see that there is a total of 4 worksheets. The 3 worksheets are redundant. Delete all the worksheets except the sheet name mid_sem_1. Rename the sheet name from mid_sem_1 to final_result.
Step 18: The final merged table appears.
Similar Reads
How to Create a Chart from Multiple Sheets in Excel
Creating a chart from multiple sheets in Excel is a powerful way to consolidate data and visualize it in a meaningful way. Whether you're working with different datasets on separate sheets or need to compare data across multiple tabs, knowing how to create a chart from multiple sheets in Excel can s
5 min read
Combine Multiple Excel Worksheets into Single Dataframe in R
In this article, we will discuss how to combine multiple excel worksheets into a single dataframe in R Programming Language. The below XLSX file "gfg.xlsx" has been used for all the different approaches. Method 1: Using readxl package The inbuilt setwd() method is used to set the working directory
4 min read
How to read a XLSX file with multiple Sheets in R?
In this article, we are going to see how to read an XLSX file with multiple Sheets in R Language. There are various external packages in R used to read XLSX files with multiple sheets. File Used: Method 1: Using readxl package The readxl package in R is used to import and read Excel workbooks in R,
5 min read
How to read multiple data files into Pandas?
In this article, we are going to see how to read multiple data files into pandas, data files are of multiple types, here are a few ways to read multiple files by using the pandas package in python. The demonstrative files can be download from here Method 1: Reading CSV files If our data files are in
3 min read
How to Insert Multiple Columns in Google Sheets
Mastering Google Sheets is more than just knowing how to enter data â it's about making your spreadsheets work for you! Whether youâre managing a project, analyzing data, or collaborating with a team, knowing how to efficiently insert multiple columns in Google Sheets can save you time and keep your
9 min read
How to combine two DataFrames in Pandas?
While working with data, there are multiple times when you would need to combine data from multiple sources. For example, you may have one DataFrame that contains information about a customer, while another DataFrame contains data about their transaction history. If you want to analyze this data tog
3 min read
How to Merge Multiple Excel Files into one Folder?
Power Query is a data manipulation tool frequently used for business intelligence and data analysis. Both Microsoft Excel and Microsoft Power BI support Power Query. A single source of truth and well-organized, error-free data are requirements for high-quality analysis. While many analysts spend man
4 min read
How to read multiple Excel files in R
In this article, we will discuss how to merge multiple Excel files in the R programming language. Modules Used:dplyr: The dplyr package in R is a structure of data manipulation that provides a uniform set of verbs, helping to resolve the most frequent data manipulation hurdles.plyr: The âplyrâ packa
2 min read
Export Dataframes to Multiple Excel Sheets in R
An excel workbook is used to contain tabular information stored within a cell-like structure. Every excel workbook in R contains multiple sheets to contain the data belonging to the same domain information. The excel sheet can contain columns belonging to different data types. The Excel files can be
5 min read
How to Open a CSV File in Google Sheets
Ever received a data dump in a mysterious file format called CSV? Don't worry, it's not an alien language! CSV stands for "Comma-Separated Values," and it's a common way to store data in rows and columns. But how do you unlock this treasure trove of information? Fear not, data warrior! This guide wi
5 min read