Here, we have a dataset containing the sales data of 5 shops for three consecutive months: January, February, and March. We will use this dataset to show you how to make multiple Pie Charts from one table in Excel.
Method 1 – Using the Pie Charts Feature in Excel
Steps:
- Select cell range B4:C9.
- Go to the Insert tab >> click on Pie Chart >> select 2-D Pie chart.
- A Pie Chart will appear with the Sales data for January.
- Click on the “+” sign to open Chart Elements.
- Turn on Data Labels.
- Select cell range B4:B9 and D4:D9.
- Go to the Insert tab >> click on Pie Chart.
- Select the 2-D Pie chart.
- A Pie Chart will appear containing the Sales data for February.
- Click on the “+” sign to open Chart Elements.
- Turn on Data Labels.
- Select cell range B4:B9 and E4:E9.
- Go to the Insert tab >> click on Pie Chart.
- Select the 2-D Pie chart.
- A Pie Chart will appear containing the Sales data for March.
- Click on the “+” sign to open Chart Elements.
- Turn on Data Labels.
- You will get 3 separate Pie Charts for January, February, and March from one table using Pie Charts.
Read More: How to Make a Pie Chart in Excel
Method 2 – Applying a Doughnut Chart to Make Two Pie Charts in One from One Table
Steps:
- Select cell range B4:D9.
- Go to the Insert tab >> click on Pie Chart.
- Select the Doughnut chart.
- A Doughnut chart will appear containing the Sales data for January and February.
- Select the smaller Doughnut chart.
- The Format Data Series toolbox will open.
- Insert 0% in the Doughnut Hole Size box.
- Click on the Chart Title to change it.
- Type Sales Analysis as Chart Title.
- Click on the “+” sign to open Chart Elements.
- Turn on Data Labels.
- You will get two Pie Charts in one from one table by applying the Doughnut Chart.
Read More: How to Make Pie of Pie Chart in Excel
Method 3 – Using VBA to Make Multiple Pie Charts from One Table
Steps:
- Go to the Developer tab >> click on Insert >> select Command Button.
- Insert CommandButton1.
- Right-click on the button.
- Click on CommandButton Object >> select Edit.
- Type Create Pie Chart to edit the Command Button.
- Right-click on the Create Pie Chart button.
- Select View Code.
- You will see the code for CommandButton1_Click.
- Enter the following code in your Module:
Option Explicit
Private Sub CommandButton1_Click()
Multiple_Pie_Charts
End Sub
Sub Multiple_Pie_Charts()
Dim Sales As Worksheet
Set Sales = Worksheets("Using VBA")
Dim sales_chart As ChartObject
For Each sales_chart In Sales.ChartObjects
sales_chart.Delete
Next
Dim Rng() As String
ReDim Rng(1 To 4)
Rng(1) = "C5"
Rng(2) = "D5"
Rng(3) = "E5"
Dim Sales_Pie_Chart As New Chart
Dim Sells_Series As Series
Dim row_number As Integer
Dim move_left As Integer
move_left = 10
For row_number = LBound(Rng) To UBound(Rng) - 1
Set Sales_Pie_Chart = Sales.ChartObjects.Add _
(Width:=170, Height:=170, _
Top:=210, Left:=move_left).Chart
With Sales_Pie_Chart
.ChartType = xlPie
.HasTitle = True
.ChartTitle.Text = Sales.UsedRange.Rows.Cells _
(3, row_number + 1)
Set Sells_Series = .SeriesCollection.NewSeries
With Sells_Series
.XValues = Sales.Range(Sales.Range("B5"), _
Sales.Range("B5").End(xlDown))
.Values = Sales.Range(Sales.Range(Rng(row_number)), _
Sales.Range(Rng(row_number)).End(xlDown))
End With
.SeriesCollection(1).HasDataLabels = True
End With
move_left = move_left + 180
Next row_number
End Sub
Code Breakdown
- First, we created Sub Procedure as Multiple_Pie_Charts().
- Then, we declared Sales as Worksheet.
- After that, we set the Sales from Using VBA Worksheet.
- Next, we declared sales_chart as ChartObject.
- Then, we created a For loop for each sales_chart in the Sales worksheet to delete previous charts while creating new charts.
- Afterward, we declared Rng() as String and redeclared Rng from 1 to 4.
- Next, we inserted Rng(1) =”C5″ ,Rng(2) =”D5″ and Rng(3) =”E5″.
- Then, we declared Sales_Pie_Chart as a New Chart, Sells_Series as Series, row_number as Integer and move_left as Integer.
- After that, we inserted move_left=10.
- Again, we used a For loop for row_number Lower Bound of Rng to Upper Bound of Rng subtracted by 1.
- Next, we set the Sales_Pie_Chart as a Chart containing Width=170, Height= 170, Top=210 and Left=move_left.
- Then, with the Sales_Pie_Chart we selected xlPie as ChartType, set Title as True and set the value as Cell (3, row_number+1) where values of the given row & column will be displayed as Chart Title.
- After that, with Sells_series we inserted XValues from the Sales worksheet as Cell B5.
- Moreover, we inserted Values from the Sales worksheet as Rng(row_number).
- Then, we set the Data Labels as True.
- After that, we inserted move_left= move_left+180 it will shift the Charts towards right and will create a gap between charts.
- Click on the Save button and go back to your worksheet.
- Click on the Create Pie Chart button.
- You will get 3 separate Pie Charts for January, February and March from one table using VBA.
Read More: How to Make a Multi-Level Pie Chart in Excel
Make One Pie Chart from Multiple Tables
We can also make one pie chart from multiple tables in Excel by going through some steps.
Here, the above dataset shows the values of Sales of the Shops in January.
The above dataset shows the values of Sales of the Shops in February.
The above data set shows the values of Sales of the Shops in March.
We will consolidate the Sales value of the 3 months using the Consolidate Feature.
Steps:
- Open a new Worksheet and prepare the worksheet for the consolidated data.
- Select cell B4.
- Go to the Data tab >> click on Data Tools >> select Consolidate.
- The Consolidate dialog box will open.
- Select Sum as Function.
- In the Reference box insert the cell range B4:C9 from the worksheet January.
- Press Add.
- In the Reference box, insert the cell range B4:C9 from the worksheet February.
- Press Add.
- In the Reference box, insert the cell range B4:C14 from the worksheet February.
- Pess Add.
- Activate the Top row and Left column.
- Press OK.
- You will find the consolidated sum of Sales values for the three consecutive months applying the Consolidate Feature.
- Go to the Insert tab >> click on Pie Charts.
- Select the 2-D Pie chart.
- Click on the “+” sign to open Chart Elements.
- Turn on Data Labels.
- You will get one pie chart from multiple tables in Excel.
Read More: How to Create a 3D Pie Chart in Excel
Practice Section
Here is the dataset to practice on your own.
Download the Practice Workbook
Related Articles
- How to Make a Gender Pie Chart in Excel
- How to Create & Customize Bar of Pie Chart in Excel
- How to Make a Budget Pie Chart in Excel
<< Go Back To Make a Pie Chart in Excel | Excel Pie Chart | Excel Charts | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!