Got any Excel/VBA Questions? Free Excel Help
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:
=SUMPRODUCT(($A$1:$A$20>D1)*($A$1:$A$20<E1))
Where D1 houses your start date and E1 you end date.
Or, we can hard code the dates into our SUMPRODUCT Function by using the DATE Function.
=SUMPRODUCT(($A$1:$A$20>DATE(2010,7,29))*($A$1:$A$20<DATE(2010,8,1)))
Syntax for the date function is: DATE(Year, Month, Day)
See also: Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions and Index to new resources and reference sheets
See also:
Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.
Microsoft ® and Microsoft Excel ® are registered trademarks of Microsoft Corporation. OzGrid is in no way associated with Microsoft.