Dennis has a worksheet where each row contains information about a project, including a start date and end date for the project. He would like a summary that shows a count of projects active during each date of a particular month. If the start dates are in column C, the end dates in column D, and the date for the month in question is in cell S1, Dennis wonders how he can get a project count for each day in that month starting in cell S5.
There are two parts to what Dennis needs. The first is to generate the list of dates for the month and the second is to generate the actual project counts for those dates. Dennis can generate the first day of the month by using this formula in cell S5:
=S1+1-DAY(S1)
Then, in cell S6, Dennis would enter the following formula to come up with the second day of the month:
=IF(MONTH($S$5+ROW()-ROW($S$5))=MONTH($S$5),$S$5+ROW()-ROW($S$5),"")
Note that a simple increment of the date in S5 could have worked, but the much more complex IF statement is helpful when copying the formula down into the range S7:S35. The formula will display every date for the month, leaving the remaining cells in the range blank. You'll then want to format the range S5:S35 to display dates in the format you prefer.
If you are using Excel 2021 or a later version, you can make the date generation even easier. Place the following formula into cell S5:
=SEQUENCE(DAY(EOMONTH(S1,0)),1,EOMONTH(S1,-1)+1)
The formula spills all the dates in the month downward. You'll still need to select the cells, however, and format them as dates.
With the month's dates in place, you can then generate the desired counts. Consider the date in cell S5. You want a count of any project whose start date is on or before that date and whose end date is on or after that date. The following formula, entered in cell T5, will work great for this purpose:
=COUNTIFS($C:$C,"<="&S5,$D:$D,">="&S5)
Before copying the formula down through cell T35, you will probably want to wrap it in an IF statement, like this:
=IF(S5="","",COUNTIFS($C:$C,"<="&S5,$D:$D,">="&S5))
This checks to make sure that the date in column S is actually there before attempting to do a count.
If you used the SEQUENCE function, described earlier, to spill the month's dates in cell S5, and you are using Excel 2024 or Microsoft 365, you can build on the SEQUENCE formula by using the following formula in cell T5:
=MAP(S5#,LAMBDA(d,COUNTIFS($C:$C,"<="&d,$D:$D,">="&d)))
This uses the spilled dates beginning in cell S5 (those generated by the SEQUENCE formula) to do a count based on each date.
Finally, there is a caveat that should be mentioned. The solutions presented for Dennis in this tip are only as good as the data on which those formulas are based. If, for instance, there are any blanks in the end-dates for projects, that will cause errors. Also, it is assumed that the end date for a project will always be after the start date. (In other words, the dates for a given project are in the proper chronological order.)
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (14016) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel Data Analysis and Business Modeling today!
If your company closes out its accounting months at the end of each calendar quarter, figuring out the proper closing ...
Discover MoreNeed to figure out if a given year is a leap year? It's not as easy as you think! This tip provides a plethora of ways ...
Discover MoreWhen working with dates, it is often helpful to be able to calculate some date in the future based on a starting date. ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2026 Sharon Parq Associates, Inc.
Comments