Count End Dates Within 30 Days Using COUNTIFS in Excel and WPS
Question details
Count records with type Best and an end date no later than 30 days after today.

- Product
- WPS Spreadsheets and Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains record types in one column and end dates in another.
- Observed behavior
- The desired count updates with today's date and includes records that meet the specified type and date criteria.
Check that the type and end-date ranges cover the same rows and that end dates are stored as dates rather than text. Decide whether past dates should be included or whether the count should start today.
Count Best records ending no later than 30 days from today
Use an upper date limit when past end dates should also qualify.
Click an empty cell where you want the count to appear.
Enter =COUNTIFS(A2:A5,"Best",B2:B5,"<="&TODAY()+30) and press Enter. Replace the ranges with your type and end-date ranges.
If you plan to copy the formula, use absolute references: =COUNTIFS($A$2:$A$5,"Best",$B$2:$B$5,"<="&TODAY()+30).

Count Best records ending from today through the next 30 days
Add a lower date limit to exclude past dates and blank end-date cells.
Use COUNTIFS and TODAY in WPS Spreadsheets
Enter a COUNTIFS formula in WPS Spreadsheets to count Best records by end date and have the date limits update with TODAY().
- 1. Open the worksheet: Open WPS Spreadsheets and choose Open to select your workbook.
- 2. Check the data ranges: Locate the type column and end-date column, and note the rows containing your records.
- 3. Enter the formula: Click an empty cell and enter =COUNTIFS(A2:A5,"Best",B2:B5,">="&TODAY(),B2:B5,"<="&TODAY()+30), replacing the ranges as needed.
- 4. Calculate the count: Press Enter to display the number of matching records.

Frequently Asked Questions
Does the upper-limit formula include overdue dates?
Yes. =COUNTIFS(A2:A5,"Best",B2:B5,"<="&TODAY()+30) has no lower date limit, so past dates qualify. Add B2:B5,">="&TODAY() to exclude them.
How do I include both today and the date 30 days from now?
Use the criteria ">="&TODAY() and "<="&TODAY()+30 on the same end-date range. Both comparison operators include their boundary dates.
Why are some dates not being counted?
Check that the end-date cells contain actual spreadsheet dates rather than text and that the type and date ranges cover the same rows. Also check whether the formula's date limits include the dates you expect.
How can I copy the formula without changing its ranges?
Use absolute references such as $A$2:$A$5 and $B$2:$B$5 before copying the formula to another cell.




