# 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:

• Step 1: (TODAY() + 10): To have the date ten days after. If today is November 18, 2022, the date ten days after is November 28, 2022;
• Step 2: (C2:C12 < TODAY() + 10): If a date is before November 28, 2022, it returns TRUE; otherwise, it returns FALSE;
• Step 3: (C2:C12 > TODAY()): If a date is after November 18, 2022, it returns TRUE; otherwise, it returns FALSE;
• Step 4: The hyphen (or times one) converts TRUE into one and FALSE into zero;
• Step 5: The SUMPRODUCT function returns the sum of the products of the new array.

### 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.