Count Dates Within Date Range

  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><meta http-equiv="Content-Language" content="en-us"><title>Count Between Date Ranges</title><meta name="description" content="Count Between Date Ranges"><meta name="keywords" content="Count Between Date Ranges"><link rel="STYLESHEET" href="http://www.ozgrid.com/css/ozgrid.css" type="text/css"><script type="text/javascript" src="http://www.ozgrid.com/SideNavJS/stmenu.js"></script>
    </head><body><a name="top"></a><h1>Count Between Date Ranges</h1><h2>Count Between Date Ranges. See also: <a href="sum-between-dates.htm">Sum between date ranges</a></h2><p class="j">To count dates that fall between a date range we can use SUMPRODUCT with a twist. Suppose you have a list of valid dates in A1:A20. The formula we can use to count dates that fall between 2 dates is;<br><br><b>=SUMPRODUCT(($A$1:$A$20&gt;D1)*($A$1:$A$20&lt;E1))</b><br><br>Where D1 houses your start date and E1 you end date.<br><br>Or, we can hard code the dates into our SUMPRODUCT Function by using the DATE Function.<br><br><b>=SUMPRODUCT(($A$1:$A$20&gt;DATE(2010,7,29))*($A$1:$A$20&lt;DATE(2010,8,1)))</b><br><br><i><b>Syntax for the date function is: DATE(Year, Month, Day)</b></i></p></body></html>