Count records between two dates in excel
This blog article is one out of four articles on the same subject.
- Most common value between two dates in excel
- Count records between two dates in excel
- Count unique distinct records in a date range
- Count unique records by date
Someone googled "Count records between date range" and landed on my website. I realize I have not covered this problem.
Yellow cells are user input cells.
How do I automatically count records in a specific date range?
=SUM(IF(($A$2:$A$10<$D$2)*($A$2:$A$10>$D$1), 1, 0)) + Ctrl + Shift + Enter
Alternative formula: =SUMPRODUCT(--($A$2:$A$10<$D$2),--($A$2:$A$10>$D$1)) + ENTER
This is an array formula so make sure you press Ctrl + Shift + Enter.
If you want to count the start date and end date also, try this formula:
=SUM(IF(($A$2:$A$10<=$D$2)*($A$2:$A$10>=$D$1),1,0)) + Ctrl + Shift + Enter
Alternative formula: =SUMPRODUCT(--($A$2:$A$10<=$D$2),--($A$2:$A$10>=$D$1)) + ENTER
Download excel sample file for this tutorial.
count-records-between-two-dates-in-excel
(Excel 97-2003 Workbook *.xls)
Functions in this article:
SUM(number1,[number2],)
Adds all the numbers in a range of cells
IF(logical_test;[value_if:true];[value_if_false])
Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE
This blog article is one out of four articles on the same subject.
- Most common value between two dates in excel
- Count records between two dates in excel
- Count unique distinct records in a date range
- Count unique records by date
Related posts:
- Count date records between two dates in a range in excel
- Count unique records by date in excel
- Sum values between two dates with criteria in excel
- Most common value between two dates in a range in excel
- Count unique distinct records in a date range and a numeric range in excel
- Most common value between two dates in excel
- Count unique distinct values in a column in excel
- Count unique and unique distinct values in a multicolumn range in excel
- Count duplicate distinct values in a column in excel
- Count unique distinct months in excel




May 5th, 2009 at 7:05 pm
This did a great job of giving me what I needed, with a minor tweak in that I took out the $ in $D$2 and $D$1 and replaced with D2 & D3, respectively.
In case someone might ask why, it easily replicates the formula multiple times by copy/paste methods. Otherwise, copying and pasting into the next cell to total the difference between the next two dates on a long list of dates will simply copy the same exact formula 30 timess. The $ make the cell range entered constant, ignoring Excel's internal mechanisms that would otherwise tell the formula to automatically adjust to the new formula location (d3&d2, d4&d3, d5&d4, etc.). You still want to use the ctrl+enter, though. I had about 300 rows with dates ranging over two months to work with.
Thanks so much!
May 5th, 2009 at 9:08 pm
Thanks for your comment!