Site icon ExcelNotes

How to Count Cells in the Next Ten Days

You can use the COUNTIFS function or the SUMPRODUCT function to count the number of cells in the next ten days.

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 people have appointments in the next ten days?

=COUNTIFS(C2:C12, ">"&TODAY(), C2:C12, "<"&TODAY() + 10)

The result returns 3, so three appointments are in the next ten days if today is November 18, 2022. You can change ten in the formula to any other number of days.

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

=SUMPRODUCT(–(C2:C12 > TODAY()), –(C2:C12 < TODAY() + 10))

=SUMPRODUCT(((C2:C12 > TODAY())*1), ((C2:C12 < TODAY() + 10)*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