If you have a list on your worksheet, and a date in each row, you can get Excel to count how many dates are in a specific date range. For example, how many Pencil shipments went out in September, based on the Ship Date column?
Use COUNTIFS and Cell References
The easiest way to find the number of shipments is to use the COUNTIFS function (Excel 2007 and later) and enter the product name, and the start and end dates on the worksheet.
In this example, there is a drop down list of products in cell A2. The Start date is entered in cell D1, and the End date in cell D2.
To calculate the number of Pen shipments in the date range, enter this formula in cell F2:
- The first argument, B5:B18, is the first range to check for criteria.
- The 2nd argument, A2, is the range with the value for criteria 1 (Product)
- The 3rd argument, F5:F18, is the range to check for criteria 2.
- The 4th argument, ">="&D1, is the cell with the value for criteria 2 (the Start date), and the operator to use with that value (greater than or equal to)
- The 5th argument, F5:F18, is the range to check for criteria 3.
- The 6th argument, "<="&D2, is the range with the value for criteria 3 (the End date), and the operator to use with that value (less than or equal to)
The result will show a count of the number of times that all the criteria are met.
To get the total units for a different date range, change the product name or start and end dates in the heading section. In the next screen shot, the result shows that there was 1 Binder shipment between August 15th and September 15th.
Dashboard Course Discount Deadline
And speaking of dates, today is the deadline to get a 20% discount on Mynda Treacy’s upcoming Excel Dashboard Course. It’s a great course, and will quickly get you up and running with dashboards.