Count Dates by Quarter, Year, and Multiple Criteria in Excel
Question details
Count records in a selected quarter and year that also match two text criteria.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains dates and two text fields, and the user wants a count based on a chosen quarter, year, and two text values.
- Observed behavior
- The desired result is a count of rows that meet all four conditions.
Make sure the dates in column C are stored as actual Excel dates. Enter a quarter number from 1 to 4 in D6, a four-digit year in E6, and the two text criteria in G2 and G3.
Count matching records with COUNTIFS and quarter date boundaries
Use this formula to count rows that match the selected quarter, year, and both text criteria.
The formula includes dates on or after the first day of the selected quarter and before the first day of the next quarter. The exclusive end boundary also includes date values with times on the last day of the quarter.
Place the first text field in A2:A25, the second in B2:B25, and the dates in C2:C25. Adjust these ranges in the formula if your data is elsewhere.
Enter the quarter number in D6, the year in E6, and the matching text values in G2 and G3.
Select an empty cell and enter =COUNTIFS($C$2:$C$25,">="&DATE(E6,(D6-1)*3+1,1),$C$2:$C$25,"<"&EDATE(DATE(E6,(D6-1)*3+1,1),3),$A$2:$A$25,$G$2,$B$2:$B$25,$G$3). Press Enter.

Count quarterly records with criteria in WPS Spreadsheet
Use COUNTIFS, DATE, and EDATE in WPS Spreadsheet to count rows for a selected quarter and year that match two text values.
- 1. Open your workbook: Open WPS Spreadsheet and use Open to select your Excel workbook.
- 2. Set up the criteria: Enter a quarter number in D6, a year in E6, and the two text values in G2 and G3.
- 3. Enter COUNTIFS: Select an empty cell and enter =COUNTIFS($C$2:$C$25,">="&DATE(E6,(D6-1)*3+1,1),$C$2:$C$25,"<"&EDATE(DATE(E6,(D6-1)*3+1,1),3),$A$2:$A$25,$G$2,$B$2:$B$25,$G$3).
- 4. Check the result: Press Enter and verify the count. If your data is in different cells, edit the formula ranges to match your worksheet.

Frequently Asked Questions
How does the formula identify the selected quarter?
DATE(E6,(D6-1)*3+1,1) returns the first day of the quarter specified in D6 and the year in E6. EDATE then returns the first day three months later.
Will the formula count dates that include times?
Yes. The formula uses a date earlier than the first day of the next quarter as its upper boundary, so times on the quarter's last day are included.
Why is my COUNTIFS result lower than expected?
Check that C2:C25 contains actual date values, that D6 is a number from 1 to 4, and that G2 and G3 contain the intended text. Also confirm that the three source ranges cover corresponding rows.
Can I select the text criteria from drop-down lists?
Yes. Select G2 or G3 in Excel, choose Data > Data Validation, and set Allow to List. The COUNTIFS result will update when you choose a different value.




