Home > Pivot Table > > Count Blanks Pivot Table Count Blanks Source DataIn an Excel pivot table, discover how to count blanks from source data cells. Solutions for problem trying to count empty cells in data source, along with filled cells. Step-by-step video, written steps, screen shots, sample Excel workbook to download |
Ex 1: Blank Cells in Product DataIn the product sales data shown below, cell C7, in the Qty column, is blank.
Count Product OrdersUsing that product sales data, we want to create a pivot table that shows the number of orders for each product. To get the pivot table started, follow these steps:
Test 1: Count of Qty FieldUsually, we put numeric fields into the Values area of a pivot table. To see what happens with this data, follow these steps:
Because one of the Qty cells is blank, it is not counted in the pivot table layout.
Test 2: Use Different FieldInstead of using the Qty field for the count, use a different field, to fix the problem To get the count of all orders, even if the Qty cells are blank, follow these steps:
Because none of the Product cells are blank, the count includes all the orders.
TIP: Rename the Count of Product column as "Orders" |
Ex. 2: Blank Text Cells in Source DataThis is the second example from the video, and the goal is to show a count of orders from each District There are 3 Districts where orders are sold:
In the source data, most records show the name of the District where the order was sold. However, for some of the order records, the District name cell has been left blank. In the pivot table, we want to see a count of those records too.
Add District to Pivot TableHere are the steps for counting the orders from each district, including any orders with a blank cell in that column:
In the pivot table, you can see a count for each district name, but the (blank) district doesn't show a count. The Count function in a pivot table can't count blanks. Get Correct Count for Blank Data CellsTo get the correct count for district orders, we can’t use the Districts field.
Then, follow these steps, to get a correct District count, including blank cells:
Now, with a different field in the pivot table, the (blank) district shows the correct count. Excel is counting items in the other column, for every row where the district name cell is blank (optional) Add a New ColumnIn some data sets, there might not be any existing column that you can trust, to have no blank cells.
After you create the new column, follow these steps:
|
Change Summary FunctionWhen you add a numerical field to the pivot table's Values area, Sum or Count will be the default summary function. The default function can't be changed -- it is applied based on the field's contents:
More Summary FunctionsAfter a field has been added to the pivot table values, you can follow these steps, and select a different summary functions:
Summary Functions - More OptionsIf you want a function that is not shown in the pop-up menu:
Count FunctionIn a pivot table, Count is the default summary function when fields with non-numeric or blank cells are added to the Values area. The pivot table Count function is like the COUNTA function, that you'd use on an Excel worksheet.
The pivot table Count function counts the following types of data:
NOT COUNTED: Blank cells in the source data are NOT counted. |
Get the WorkbookCount Blanks: To follow along with the Count Blank Entries video, download the Count Blanks in Pivot Table sample file. The workbook is in xlsx format, and does not contain any macros. More Tutorials |
Last updated: September 13, 2022 2:49 PM