How to Count Cells Between Weekdays

You can also count the number of cells between weekdays using the WEEKDAY and SUMPRODUCT functions.

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

Question: How many appointments are from Tuesday to Thursday?

=SUMPRODUCT(--(WEEKDAY(C2:C12) >= 3), --(WEEKDAY(C2:C12) <= 5))

=SUMPRODUCT((WEEKDAY(C2:C12) >= 3)*1, (WEEKDAY(C2:C12) <= 5)*1)

The result returns 5, so five appointments are from Tuesday to Thursday. 

Please note that the formula uses the default return type for the WEEKDAY function, which returns from 1 (Sunday) to 7 (Saturday). Tuesday returns three, and Thursday returns five. 

Explanation: 

  • Step 1: WEEKDAY(C2:C12): The result returns the day of the week for each date;
  • Step 2: (WEEKDAY(C2:C12) >= 3): The result returns TRUE if a date is Tuesday or after; otherwise, it returns FALSE; 
  • Step 3: (WEEKDAY(C2:C12) <= 5): The result returns TRUE if a date is Thursday or before; otherwise, it returns FALSE; 
  • Step 4: The double 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.

Leave a Reply