# Counting the Number of Dates with Matching Month Criteria

In this article,you will learn how to count the number of dates with matching month criteria in Microsoft Excel. To solve this problem, which function should we use and what should the substitute in case function does not work?

Which function should we use to solve this query and why?

In this case, we will use SUM function along with IF and Month functions or we can use SUMPRODUCT IF function along with MONTH function.

• SUM function will help to count the number of dates which are falling under the criteria by doing the total numbers
• IF function will help to mention the criteria under the formula.
• MONTH function will help to provide the month for matching.

As substitute, we can use SUMPRODUCT function along with MONTH function.

Let’s understand with example:-

We have a range of date and, in the other cell, we have criteria list of month.

• Enter the formula in cell C2
• =SUM(IF(MONTH(A2:A12)=B2,1))

• Press the key Ctrl+Shift+Enter
• The function will return 1

How to use Sumproduct function to count the number of dates with the matching month criteria?

• Enter the formula in cell D2
• =SUMPRODUCT(--(MONTH(A2:A12)=B2))

• Press Enter.
• The function will return 1

Conclusion:-When we select any month from the list, number of dates will get changed, as per selection.