Count Excel Entries by Date, Team, and Status Across Columns
Question details
Count entries for the BAOB team and a selected month where the status is PENDING, using a dynamically selected status column.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A month is chosen from a drop-down, and the relevant status may be stored in a column selected by its header.
- Observed behavior
- The desired count includes only rows matching the selected team, month, and status in the chosen column.
Confirm that the date column and the month drop-down contain real Excel dates, and identify the table headers for the team and date columns. The status-column selector should match a table header exactly.
Use COUNTIFS with a dynamically selected status column
Use this formula when the month is selected as a date and a separate cell identifies the status column.
This example assumes an Excel table named Timesheet with Fleet and Date columns. Cell B1 contains a date in the selected month, N3 contains the status-column header, A4 contains BAOB, and C3 contains PENDING.
INDEX and MATCH select the status column by header. The date criteria include the first day of the selected month and exclude the first day of the next month.
Select a date in the desired month in B1. Enter the status-column header in N3, BAOB in A4, and PENDING in C3.
Select the cell where you want the count and enter =COUNTIFS(Timesheet[Fleet],$A4,INDEX(Timesheet[#Data],0,MATCH($N$3,Timesheet[#Headers],0)),C$3,Timesheet[Date],">="&EOMONTH($B$1,-1)+1,Timesheet[Date],"<"&EOMONTH($B$1,0)+1).
Replace Timesheet, Fleet, Date, and the cell references with those used in your workbook. Change the month or status-column selection to recalculate the count.

Count entries by month and status in WPS Spreadsheet
Use COUNTIFS with INDEX and MATCH in WPS Spreadsheet to count rows for a selected team, month, and status column.
- 1. Open the workbook: Open WPS Spreadsheet and select Open to load your workbook.
- 2. Arrange the criteria: For this example, place dates in A2:A1000, teams in B2:B1000, and status data in D2:G1000 with headers in D1:G1. Enter a date in the selected month in K1, the status-column header in K2, BAOB in K3, and PENDING in K4.
- 3. Enter the count formula: Select an empty cell and enter =COUNTIFS($B$2:$B$1000,$K$3,INDEX($D$2:$G$1000,0,MATCH($K$2,$D$1:$G$1,0)),$K$4,$A$2:$A$1000,">="&EOMONTH($K$1,-1)+1,$A$2:$A$1000,"<"&EOMONTH($K$1,0)+1).
- 4. Adjust and save: Change the ranges and criteria cells to match your sheet, then select File > Save As to save the workbook in an Excel-compatible format.

Frequently Asked Questions
Why does the formula use two date criteria?
The first criterion includes dates on or after the first day of the selected month. The second excludes dates on or after the first day of the next month, including any later times on the last day.
What if my month drop-down contains text instead of dates?
Use a real date for each drop-down option and format the cells to display the month name. Include a year in the underlying date so the formula counts the intended month and year.
Why does MATCH return an error?
Check that N3 exactly matches a header in Timesheet[#Headers]. Remove extra spaces or correct any spelling differences in the selector or header.
Can I count a status other than PENDING?
Yes. Replace PENDING in C3 with the status you want to count. The COUNTIFS formula will use the new value in the selected status column.




