Exclude Blank Cells from Excel Counts and Pie Charts
Question details
Count repeated values and create a pie chart without including blank cells or unused rows.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains a list of records with unused rows, and the user wants to chart the frequency of each populated value.
- Observed behavior
- The desired result is a count summary and pie chart based only on populated values.
Identify the column containing the values to count and reserve two empty columns for the unique labels and their counts. Adjust the example sheet name and cell ranges to match your workbook.
Count Nonblank Values and Chart a Summary Table in Excel
Use COUNTIFS to count each populated value, then chart only the filled summary rows.
Copy the values from 'MY TRADING JOURNAL'!E11:E1070 into an empty summary column, such as M. Select the copied list and choose Data > Remove Duplicates, then delete any blank entry.
In N3, enter =COUNTIFS('MY TRADING JOURNAL'!$E$11:$E$1070,M3,'MY TRADING JOURNAL'!$E$11:$E$1070,"<>") and fill the formula down beside the labels. Add headers above the labels and counts.
Select the headers and populated label-and-count rows, then choose Insert > Pie Chart. Do not include unused summary rows in the selection.
When new labels appear, add them and their count formulas to the summary. Right-click the chart, choose Select Data, and adjust the chart data range to include the populated rows.

Use an Excel Table to Expand the Chart Source
Use a table when you expect to add new labels to the count summary over time.
Count Nonblank Values and Build a Pie Chart in WPS Spreadsheets
Use COUNTIFS in WPS Spreadsheets to summarize populated values, then select the filled summary rows to create a pie chart.
- 1. Open the workbook: Open WPS Spreadsheets and use File > Open to select your workbook.
- 2. List the labels: In an empty column, enter each nonblank value you want to count once, with a header above the list.
- 3. Calculate the counts: In the adjacent column, enter =COUNTIFS('MY TRADING JOURNAL'!$E$11:$E$1070,M3,'MY TRADING JOURNAL'!$E$11:$E$1070,"<>") and fill it down. Change the references to match your sheet and label column.
- 4. Create the chart: Select the populated labels and counts, including their headers, and choose Insert > Chart > Pie.

Frequently Asked Questions
How do I count a value without counting blank cells?
Use COUNTIFS with the value as one criterion and "<>" as a second criterion on the same range. For example, =COUNTIFS(E11:E1070,M3,E11:E1070,"<>") counts nonblank cells matching M3.
How can I show only duplicates in my pie chart?
Count each unique label, then select only labels with counts greater than 1 and their corresponding counts when you insert the pie chart.
Will an Excel Table automatically remove blanks from a chart?
No. A table can expand when you add rows, but you should remove blank labels from the summary or otherwise exclude them from the chart source.
How do I change the rows included in an existing chart?
Right-click the chart, choose Select Data, and change the chart data range to cover only the populated labels and counts.




