logo
search
Function Problems

How to Count Dates Older Than 7, 14, or 30 Days in Excel

Maira MehtabMaira Mehtab Sep 22, 2026 869 views

Question details

The user wants to count the number of dates in a dataset that are older than a specific number of days or fall within a recent rolling date range using Excel formulas.

Product
Excel
Device & OS
not provided
Scenario
Tracking aging items, monitoring overdue tasks, or analyzing data based on rolling timeframes like 7, 14, or 30 days.
Observed behavior
The user requires specific COUNTIF and COUNTIFS formulas incorporating the TODAY function to calculate dynamic date thresholds.
Before you start

Ensure your date column is formatted as valid dates rather than plain text, and verify the exact cell range containing the dates you want to evaluate.

Solution 1Recommended

Count dates strictly older than a specific number of days

Use the COUNTIF function combined with the TODAY function to find dates that are older than your target number of days (e.g., 7, 14, or 30 days).

The TODAY() function dynamically retrieves the current system date. By subtracting a set number of days from TODAY(), you can create a rolling threshold to count past dates.

1
Select the output cell

Click on an empty cell where you want the total count result to be displayed.

2
Enter the COUNTIF formula

Type the formula =COUNTIF(H2:H149,"<"&TODAY()-7), replacing 'H2:H149' with the actual range containing your dates.

3
Adjust the timeframe if necessary

To check for 14 or 30 days instead of 7, simply change the number 7 in the formula to 14 or 30 (e.g., =COUNTIF(H2:H149,"<"&TODAY()-30)).

4
Calculate the result

Press Enter to execute the formula. Excel will display the total number of dates that meet the criteria.

Dynamic Updates: Because the TODAY() function updates daily, this formula will automatically recalculate the count each time you open the workbook.
Use WPS Spreadsheet for Advanced Formulas

Easily Calculate Date Differences with WPS Office

WPS Spreadsheet offers full support for COUNTIF, COUNTIFS, and TODAY functions, allowing you to seamlessly analyze aging reports, track overdue dates, and manage timelines.

  1. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open the workbook containing the dates you want to evaluate.
  2. 2. Apply the COUNTIF formula: Select an empty cell and enter the formula =COUNTIF(range,"<"&TODAY()-days).
  3. 3. Press Enter to execute: Hit Enter to instantly calculate the count of older dates.
  4. 4. Explore more functions: Navigate to the Formulas tab to easily insert other Date and Time functions for complex calculations.
100% compatible with Microsoft Excel formulas and .xlsx files.Built-in formula suggestions and error-checking tools.Lightweight application with fast processing for large datasets.Free to use with a familiar, user-friendly interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my COUNTIF formula returning 0 for dates?

This usually happens if the dates in your range are formatted as text rather than actual date values. To fix this, select your date range, go to the Home tab, and change the number format to 'Short Date'. Alternatively, use the 'Text to Columns' feature to convert them into real dates.

Can I reference a cell for the number of days instead of typing it in the formula?

Yes. Instead of typing the number directly (e.g., -7), you can reference a cell that contains the number of days. If cell A1 contains the number 7, your formula would look like: =COUNTIF(H2:H149,"<"&TODAY()-A1).

How do I count dates that match exactly today's date?

To count cells that contain today's date only, use the formula without any greater/less than operators: =COUNTIF(H2:H149, TODAY()).

Do these formulas update automatically tomorrow?

Yes, because the TODAY() function is volatile, the formulas will automatically recalculate the date differences based on your computer's current system date whenever the workbook is opened or modified.