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 on Friday?
The result returns 3, so three appointments are on Friday.
- Step 1: WEEKDAY(C2:C12): The result returns the day of the week for each date;
- Step 2: (WEEKDAY(C2:C12)=6): The result returns TRUE if the date is a Friday, or FALSE if not;
- Step 3: The hyphen (or times one) converts TRUE into one and FALSE into zero;
- Step 4: 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.
=SUMPRODUCT(array1, [array2], …)
– Array1 is required; the first array is to multiply and add.
– Array2 is optional; the second array is to multiply and add.