Count Filtered Excel Records by Month and Status with SUMPRODUCT
Question details
Count filtered records for a selected month and status in Excel.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains issue dates and statuses, and the user wants to count visible records such as closed issues in June.
- Observed behavior
- A month-based SUMPRODUCT count needs to respect the active filter and include a status criterion.
Identify the date and status columns and confirm that the date cells contain valid Excel dates rather than text. In the examples below, dates are in B6:B20 and statuses are in C6:C20.
Use SUMPRODUCT and SUBTOTAL to count visible matching rows
Use this formula when the count should update as worksheet filters change.
Select the table and choose Data > Filter, then apply the filters you need.
Select an empty cell and enter =SUMPRODUCT(SUBTOTAL(3,OFFSET(B6,ROW(B6:B20)-ROW(B6),0,1)),--(B6:B20<>""),--(MONTH(B6:B20)=6),--(C6:C20="Closed"))
In the formula, replace 6 with another month number, change "Closed" to the required status, and adjust both ranges to cover the same rows.
Change a filter using the column dropdown and confirm that the formula counts only visible rows with a June date and the specified status.

Group dates by month in an Excel PivotTable
Use a PivotTable to summarize counts by month and filter them by status.
Count filtered records by month and status in WPS Spreadsheets
Use WPS Spreadsheets to filter your records and apply a visibility-aware SUMPRODUCT formula for the month and status you need.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
- 2. Check dates and filter: Confirm that the date column contains valid dates, then select your table and choose Data > Filter.
- 3. Enter the formula: In an empty cell, enter =SUMPRODUCT(SUBTOTAL(3,OFFSET(B6,ROW(B6:B20)-ROW(B6),0,1)),--(B6:B20<>""),--(MONTH(B6:B20)=6),--(C6:C20="Closed")) and adjust the ranges to match your worksheet.
- 4. Test the count: Use a filter dropdown to hide some records and check that the result changes to reflect the visible matching rows.

Frequently Asked Questions
Why can't I group dates in my Excel PivotTable?
The source date field may contain text, blanks, or errors. Correct those cells, right-click the PivotTable, and choose Refresh before using Group again.
How do I count June records for one year only?
Add another condition to the SUMPRODUCT formula, such as --(YEAR(B6:B20)=2025), and replace 2025 with the year you need.
Does the formula exclude manually hidden rows?
SUBTOTAL with function number 3 excludes filtered-out rows but includes manually hidden rows. Change SUBTOTAL(3,...) to SUBTOTAL(103,...) to exclude manually hidden rows too.
How can I count a different status or month?
Edit the formula in the result cell: replace "Closed" with the status to count and replace 6 with the desired month number, from 1 for January to 12 for December.




