Try:

=SUMPRODUCT(--($M$2:$M$576>=$F$1),--($M$2:$M$576<=$G$1),--(TEXT($M$2:$M$576,"dddd")=C$2),--(MOD($M$2:$M$576,1)>=$A3),--(MOD($M$2:$M$576,1)<=$B3))
in C3 and then copied to rest of the matrix.

Note: The date range is determined by F1 and G1