Function Problems

Count End Dates Within 30 Days Using COUNTIFS in Excel and WPS

John WilsonJohn Wilson Nov 18, 2026 868 views

Question details

Count records with type Best and an end date no later than 30 days after today.

Count End Dates Within 30 Days Using COUNTIFS in Excel and WPS
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.
Before you start

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.

Solution 1Recommended

Count Best records ending no later than 30 days from today

Use an upper date limit when past end dates should also qualify.

1
Select the result cell

Click an empty cell where you want the count to appear.

2
Enter the COUNTIFS formula

Enter =COUNTIFS(A2:A5,"Best",B2:B5,"<="&TODAY()+30) and press Enter. Replace the ranges with your type and end-date ranges.

3
Lock ranges if needed

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 no later than 30 days from today
This formula has no start date: It includes past dates and may count blank date cells as zero. To count only dates from today through 30 days from today, use the next solution.
Count dates in WPS Spreadsheets

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. 1. Open the worksheet: Open WPS Spreadsheets and choose Open to select your workbook.
  2. 2. Check the data ranges: Locate the type column and end-date column, and note the rows containing your records.
  3. 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. 4. Calculate the count: Press Enter to display the number of matching records.
Count records using both type and date criteriaUse TODAY() for a rolling 30-day date limitOpen and edit Microsoft Excel XLSX filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

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.