Site icon ExcelNotes

How to Count Cells in the Next Month

You can use the COUNTIFS or SUMPRODUCT functions to count the number of cells in the next month.

Example: You are working with a worksheet with the first name in column A, the last name in column B, and the date of appointment in column C.

Question: How many appointments are in the next month?

=COUNTIFS(C2:C12, ">=" & (EOMONTH(TODAY(),0)+1), C2:C12, "<=" & (EOMONTH(TODAY(),1)))

Explanation: 

Alternatively, you can use the SUMPRODUCT function to have the same results.

=SUMPRODUCT(–(C2:C12 >= (EOMONTH(TODAY(),0)+1)), –(C2:C12 <= (EOMONTH(TODAY(),1))))

=SUMPRODUCT((C2:C12 >= (EOMONTH(TODAY(),0)+1))*1, (C2:C12 <= (EOMONTH(TODAY(),1)))*1)

Explanation: 

Notes: The SUMPRODUCT function

The SUMPRODUCT function adds all the multiplication results for all arrays.

Formula:

=SUMPRODUCT(array1, [array2], …)

Explanations:

– Array1 is required; the first array is to multiply and add.
– Array2 is optional; the second array is to multiply and add.

Exit mobile version