How to Count Nonblank Values in an Excel PivotTable by Donor
Question details
The user wants to count nonblank values, specifically donor year records, within a PivotTable but needs alternatives because standard calculated fields do not support COUNTA.

- Product
- Excel PivotTable
- Device & OS
- not provided
- Scenario
- Calculating the total number of distinct or nonblank records per donor in a dataset when standard PivotTable formulas fail.
- Observed behavior
- The standard PivotTable calculated field fails to execute the COUNTA function correctly, returning errors or inaccurate counts for donor year records.
Ensure your raw dataset is formatted as an official Excel Table (Ctrl+T) so that any formulas or PivotTables automatically capture new donor records as they are added.
Use Microsoft 365 Dynamic Array Formulas
A lightweight and dynamic method to count nonblank or unique values per donor using modern array functions outside the traditional PivotTable.
If your workflow permits calculating the values outside of a strict PivotTable environment, modern Excel dynamic array formulas offer a highly efficient workaround. By combining COUNT, UNIQUE, and FILTER, you can generate accurate donor statistics.
Select a blank cell (for example, A1) and type in the specific donor name you want to evaluate.
Select an adjacent cell and enter the formula: =COUNT(UNIQUE(FILTER(Table1[Year],Table1[Donor]=A1))). Ensure that 'Table1', 'Year', and 'Donor' match your actual table and column names.
Hit Enter on your keyboard. The formula will automatically filter the table for the specified donor and count the unique, non-blank year records associated with them.

Use Power Pivot and a DAX Measure
The best approach if you absolutely must keep the nonblank calculation securely inside a PivotTable environment.
Count Nonblank Values Using WPS Spreadsheet
You can easily summarize your donor records and count nonblank values in WPS Office using its robust PivotTable features. WPS Spreadsheet provides an intuitive interface to manage, analyze, and extract insights from your data seamlessly.
- 1. Select your data range: Open your spreadsheet in WPS Office, select your entire donor dataset, and navigate to the 'Insert' tab.
- 2. Insert a PivotTable: Click the 'PivotTable' button on the toolbar, choose whether to place it on a new or existing worksheet, and click 'OK'.
- 3. Configure row labels: In the PivotTable Field List panel on the right, drag the 'Donor' field into the 'Rows' box to group your records by donor.
- 4. Count the records: Drag your target field (e.g., 'Year' or 'Amount') into the 'Values' area. Click the field's dropdown arrow, select 'Value Field Settings', choose 'Count', and click 'OK'.

Frequently Asked Questions
Why does COUNTA return an error in my PivotTable calculated field?
Standard PivotTable calculated fields are strictly designed to handle mathematical operations (like SUM or AVERAGE) on numeric values. They do not support many standard worksheet functions, including COUNTA or text-based evaluations.
How do I count unique text values in a normal PivotTable?
When initially creating the PivotTable from your data range, check the box that says 'Add this data to the Data Model'. Once created, drag your field into the Values area, access the Value Field Settings, and scroll down to select the 'Distinct Count' aggregation option.
Can I use the UNIQUE and FILTER functions in older versions of Excel?
No, dynamic array functions such as UNIQUE and FILTER are only natively available in Microsoft 365 and Excel 2021 or later. If you are using an older version, you must rely on complex Ctrl+Shift+Enter array formulas or Power Pivot.




