Calculation Issues

Count Filtered Excel Records by Month and Status with SUMPRODUCT

Jason MillerJason Miller Nov 27, 2026 870 views

Question details

Count filtered records for a selected month and status in Excel.

Count Filtered Excel Records by Month and Status with SUMPRODUCT
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.
Before you start

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.

Solution 1Recommended

Use SUMPRODUCT and SUBTOTAL to count visible matching rows

Use this formula when the count should update as worksheet filters change.

1
Apply a filter

Select the table and choose Data > Filter, then apply the filters you need.

2
Enter the count formula

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"))

3
Adjust the criteria

In the formula, replace 6 with another month number, change "Closed" to the required status, and adjust both ranges to cover the same rows.

4
Check the result

Change a filter using the column dropdown and confirm that the formula counts only visible rows with a June date and the specified status.

Use SUMPRODUCT and SUBTOTAL to count visible matching rows
Dates and years: The formula counts June records across all years. Every nonblank cell in the date range must contain a valid date; text dates can cause an error.
Count visible spreadsheet records

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. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
  2. 2. Check dates and filter: Confirm that the date column contains valid dates, then select your table and choose Data > Filter.
  3. 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. 4. Test the count: Use a filter dropdown to hide some records and check that the result changes to reflect the visible matching rows.
Count filtered records that match a month and statusOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet functions and filtering toolsWork with a free, easy-to-use office suite
microsoft office alternative - wps office

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.