How to Count Unique Names by Month in Excel 2019
Question details
The user needs to count distinct plant names per month in Excel 2019, where duplicate names and collection months are in separate columns.

- Product
- Microsoft Excel 2019
- Device & OS
- not provided
- Scenario
- Creating a monthly summary report that requires counting unique items based on specific month criteria.
- Observed behavior
- Combining COUNTIF and SUMPRODUCT formulas fails to produce the correct unique count by month, often resulting in formula errors due to mixed data types or complex array requirements.
Ensure your data range does not contain blank rows or mixed data types in the date column, as these commonly cause advanced counting formulas to fail.
Use Power Query to Count Distinct Values
Power Query is the most reliable method for cleaning data and extracting distinct counts dynamically.
Select your data range, navigate to the 'Data' tab, and click 'From Table/Range'.
In the Power Query Editor, hold the Ctrl key to select both the 'Plant Name' and 'Month' columns, right-click the header, and choose 'Remove Duplicates'.
Right-click the 'Month' column, select 'Group By', set the new column name to 'Unique Count', and choose 'Count Rows' as the operation.
Click 'Close & Load' on the Home tab to export the summarized monthly counts to a new worksheet.

Use a PivotTable with the Data Model
Excel 2019 allows you to calculate a 'Distinct Count' directly inside a PivotTable if you add the data to the Data Model.
Use an Advanced Array Formula
If you must use formulas in Excel 2019, you can use a complex array formula, though it requires exact range matching and may slow down performance.
Easily Count Unique Values with WPS Spreadsheet
WPS Spreadsheet provides powerful PivotTable features and intuitive data analysis tools, allowing you to quickly summarize unique values by month without writing complex formulas. It offers a smooth experience for handling large datasets and generating dynamic reports.
- 1. Open your data in WPS Spreadsheet: Launch WPS Office and open your workbook containing the monthly data.
- 2. Insert a PivotTable: Select your entire data range, navigate to the 'Insert' tab, and click 'PivotTable'.
- 3. Organize your fields: In the PivotTable pane, drag the 'Month' field to Rows and the 'Plant Name' field to Values.
- 4. Summarize unique values: Click the Value field settings to adjust the calculation to count, or use the 'Data' tab's 'Remove Duplicates' feature for a quick unique list before creating your summary.

Frequently Asked Questions
Why do COUNTIF and SUMPRODUCT formulas return errors when combined?
These functions often return errors when used together for unique counts if the table ranges are oversized, contain blank cells, or have mixed data types (like text stored as dates). Array formulas require exact range matching to function correctly.
Can I group dates by month automatically in a PivotTable?
Yes, when you drag a date field into a PivotTable's Row area, you can right-click the date items and select 'Group'. From there, you can choose 'Months' and 'Years' to consolidate the data automatically.
Does Excel 2019 have the UNIQUE function?
No, the UNIQUE function is only available in Excel for Microsoft 365 and Excel 2021. For Excel 2019, you must use Power Query, Data Model PivotTables, or complex array formulas to extract unique values.




