Calculate Date Ranges and Count Group Records in Excel
Question details
Calculate the number of days since each record's creation date and count records for each assigned group within defined day ranges.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The worksheet has assigned groups in one column and creation dates in another column, and the user needs a summary by group and elapsed-day range.
- Observed behavior
- The goal is to create dynamic elapsed-day values and grouped counts that update automatically as the current date changes.
Make sure the creation-date column contains real Excel dates rather than text. In the examples below, assigned groups are in column A, creation dates are in column B, and elapsed days are calculated in column C.
Calculate elapsed days and count each group with COUNTIFS
Use this method when you need a live report of records by assigned group and age range based on today's date.
The TODAY function returns the current date, so elapsed-day results update when the workbook recalculates. Use non-overlapping COUNTIFS criteria to prevent a record from being counted in more than one range.
In cell C1, enter a heading such as Elapsed Days. In C2, enter =TODAY()-B2, then press Enter to calculate the days since the creation date in B2.
Select C2 and drag the fill handle down, or double-click the fill handle, to copy =TODAY()-B2 to every record row.
In a summary cell, enter =COUNTIFS($A:$A,"Mohit",$C:$C,"<=3") to count Mohit's records that are 3 days old or fewer. Replace Mohit with the required group name.
For the 4-to-5 day range, use =COUNTIFS($A:$A,"Mohit",$C:$C,">3",$C:$C,"<=5"). Continue the same pattern for later ranges, such as >5 and <=7, >7 and <=10, >10 and <=15, >15 and <=30, >30 and <=60, >60 and <=90, and >90 and <=180.
Use the SUM function beneath or beside your summary table, such as =SUM(B2:B10), to total the counts across all displayed date ranges.

Build a dynamic group-by-day-range report in WPS Spreadsheet
WPS Spreadsheet can calculate elapsed days with TODAY and summarize assigned groups with COUNTIFS. Open your workbook, add the helper formula, and create a compact reporting table that updates as dates change.
- 1. Open the workbook in WPS Spreadsheet: Launch WPS Office, select Spreadsheets, and open the Excel workbook containing the assigned group and creation-date columns.
- 2. Calculate elapsed days: Select the first cell in a new helper column, such as C2, type =TODAY()-B2, and press Enter.
- 3. Copy the formula to all records: Use the fill handle on the selected formula cell to fill the elapsed-days formula down the column.
- 4. Create the group range counts: In a summary area, use formulas such as =COUNTIFS($A:$A,"Mohit",$C:$C,">3",$C:$C,"<=5") and change the group and boundaries as needed.

Frequently Asked Questions
Why does =TODAY()-B2 return a large number or an error?
Check that B2 is stored as a date value. Select the cell and use Home > Number Format > Short Date; if the value remains text, convert it to a date before subtracting it from TODAY().
How do I count records that are exactly 3 days old?
Use =COUNTIFS($A:$A,"Mohit",$C:$C,3). To count every group, replace "Mohit" with a cell reference containing the group name, such as E2.
How can I make the COUNTIFS formula use a group name from a summary table?
If the group name is in E2, use =COUNTIFS($A:$A,E2,$C:$C,"<=3"). Copy the formula down to calculate the same range for each listed group.
How do I count records older than 180 days?
Use =COUNTIFS($A:$A,"Mohit",$C:$C,">180"). This counts records for Mohit whose elapsed-days value in column C exceeds 180.
Will the counts change automatically tomorrow?
Yes. Because the elapsed-days formula uses TODAY(), the values and COUNTIFS results update when the workbook recalculates on a new day.




