How to Create a Pie Chart by Count of Values in Excel (2 Methods)

Dataset Overview

To illustrate the methods, we’ve chosen a dataset with three columns: Company, Product, and Sold (Qty).

Excel Pie Chart Count of Values


Method 1 – Creating a Pie Chart Using Combined Functions

Unique Values:

  • Format the cell range B19:C23.
  • In cell B20, enter the formula:

=UNIQUE(C5:C17)

    • This formula identifies unique values from the selected cell range.

Excel Pie Chart Count of Values 2

  • Press ENTER.
  • In the cell range C20:C23, enter:

=COUNTIF($C$5:$C$17,B20)

    • This formula counts occurrences of unique values (using absolute cell references).

Excel Pie Chart Count of Values 3

  • Press CTRL+ENTER to autofill the formula.

Inserting the Pie Chart:

  • Select the cell range B20:C23.
  • Go to the Insert tab → Insert Pie or Doughnut Chart → choose Pie.

Excel Pie Chart Count of Values 4

  • Customize the chart by adjusting elements like the legend position and data labels.

Excel Pie Chart Count of Values 5

  • Select the graph.
  • From the Chart ElementsLegend → select Right. This will move the Legend to the right side of the graph.

Excel Pie Chart Count of Values 6

  • From the Data Labels → select “More Options…”.

Excel Pie Chart Count of Values 7

  • The Format Data Labels box will appear on the right side of our Workbook.
  • Select Category Name, and Legend Key from the Label Contains section.
  • Select Outside End from the Label Position section.

Excel Pie Chart Count of Values 8

  • By doing so, the Pie Chart will look like this.

Excel Pie Chart Count of Values 9

  • We added a Chart Title, increased font size, and moved the Data Labels a bit to show the Leader Lines.
  • The output represents our first method.

Excel Pie Chart Count of Values 10

Read More: How to Show Percentage and Value in Excel Pie Chart


Method 2 – Creating a Pie Chart Using PivotTable

PivotTable Approach:

  • Select the cell range C4:D17.
  • From the Insert tab, choose PivotTable.
  • Specify Existing Worksheet and cell B19 as the output location.
  • Press OK.

Excel Pie Chart Count of Values 11

  • It brings a blank PivotTable.

Excel Pie Chart Count of Values 12

  • Drag the Product field to Rows and Values in the PivotTable Fields window.
  • The PivotTable displays unique values and their counts.

PivotTable Fields

  • Creating the Pie Chart:
    • Select the PivotTable.
    • From the PivotTable Analyze tab, choose PivotChart.

PivotChart

  • In the Insert Chart window, select Pie and confirm.

Pie Chart Insert

Basic Pie Chart

  • The resulting basic Pie Chart shows value counts.

Final Output of Method 2

  • Customize the chart as needed.

Read More: How to Show Percentage in Excel Pie Chart


Practice Section

We have added a practice dataset for each method in the Excel file.

Practice Dataset


Download Practice Workbook

You can download the practice workbook from here:


Related Articles


<< Go Back To Excel Pie ChartExcel ChartsLearn Excel

Get FREE Advanced Excel Exercises with Solutions!
Rafiul Haq
Rafiul Haq

Rafiul Haq worked as an Excel and VBA Content Developer in Exceldemy for over two years and published almost 200 articles for the website. He is passionate about exploring new aspects of Excel and VBA. He received his Bachelor of Science in Mechanical and Production Engineering (MPE) from the Islamic University of Technology. Rafiul furthered his education by obtaining an MBA in Finance from the Institute of Business Administration (IBA) at the University of Dhaka. Apart from creating... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo