Count cells by weekdays

Range Reference:
Weekday:
enter the cell reference that captures the value that represents the weekday that you want to count for
Formula:

=SUMPRODUCT(--(WEEKDAY(B5:B11,2)=C16))

=SUMPRODUCT(--(WEEKDAY(B5:B11,2)=C16))