WPS Spreadsheet COUNTIFS Date Criteria Referencing Cells
Question details
The user needs to make a COUNTIFS formula use minimum and maximum dates stored in worksheet cells.
- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- A monthly Excel-compatible template must count records within a date range while allowing the boundary dates to be changed in cells.
- Observed behavior
- The date criteria are currently entered directly in each COUNTIFS formula, making the template harder to update.
Enter valid date values in the minimum-date and maximum-date cells, such as A1 and A2, and confirm that the source date column contains real dates rather than text. Identify the source date range, such as Sheet1!D:D, before editing the formula.
Reference worksheet cells in COUNTIFS date criteria
Use this method when the minimum and maximum dates are stored in cells and the formula should update automatically when those dates change.
COUNTIFS requires each comparison operator to be combined with the cell reference. Use an ampersand (&) to join the operator and date cell, such as ">"&A1. This lets the formula compare source dates against editable worksheet values.
The example below counts dates after A1 and before A2. Replace > and < with >= and <= when the boundary dates should be included.
In the worksheet, enter the starting date in cell A1, or use the cell that will hold the minimum date.
Enter the ending date in cell A2, or use the cell that will hold the maximum date.
Select the result cell and enter =COUNTIFS(Sheet1!D:D,">"&A1,Sheet1!D:D,"<"&A2), then press Enter.
To count records on the minimum and maximum dates as well, replace the operators with >= and <=: =COUNTIFS(Sheet1!D:D,">="&A1,Sheet1!D:D,"<="&A2).
Build Flexible COUNTIFS Date-Range Templates in WPS Spreadsheet
WPS Spreadsheet lets you create COUNTIFS formulas that reference editable date cells, so monthly reports recalculate automatically as the date range changes. Its Excel-compatible formula support also makes it easy to work with existing templates.
- 1. Open the workbook: Launch WPS Office, choose Spreadsheet, and open the monthly XLS or XLSX template.
- 2. Prepare the date cells: Enter the minimum and maximum dates in cells such as A1 and A2, and verify that the source date column contains recognized date values.
- 3. Insert the dynamic formula: Select the output cell and enter =COUNTIFS(Sheet1!D:D,">="&A1,Sheet1!D:D,"<="&A2), adjusting the sheet, range, and cell references to match the workbook.
- 4. Test the result: Change A1 or A2 and confirm that the COUNTIFS result updates to reflect the new date range.

Frequently Asked Questions
How do I reference a minimum date cell in COUNTIFS?
Join the comparison operator to the cell reference with an ampersand. For example, use ">="&A1 to count dates greater than or equal to the date in A1.
How can I include both the start and end dates?
Use inclusive operators in the two date criteria: =COUNTIFS(Sheet1!D:D,">="&A1,Sheet1!D:D,"<="&A2). This includes records that fall exactly on A1 or A2.
Why does COUNTIFS need an ampersand before the date cell?
The ampersand combines the comparison operator and the cell value into one criteria string. Without it, the formula may interpret the operator and cell reference incorrectly.
Can I add other conditions to the date-based COUNTIFS formula?
Yes. Add each additional criteria range and criterion after the two date conditions, such as a status range followed by "Complete".
What should I do if the formula returns zero even though dates appear in the range?
Check that the source dates and the values in A1 and A2 are stored as real dates, not text. Also confirm that the minimum date is earlier than the maximum date and that the referenced sheet and column are correct.




