You can get the total number of Mondays (including start and end dates) with this version (you do not need SUM)
=INT((WEEKDAY($B2-2)+INT($D2)-INT($B2))/7)
... and then adjust to take into account the start and end days, for example
=INT((WEEKDAY($B2-2)+INT($D2)-INT($B2))/7)-IF(WEEKDAY($D2)=2,1-MOD($D2,1))-IF(WEEKDAY($B2)=2,MOD($B2,1))
I really do not recommend it (it is much more resource intensive), but this version should give you the same result
=SUMPRODUCT((TEXT(B2+(ROW(INDIRECT("1:"&ROUND((D2-B2)*1440,0)))-0.5)/1440,"ddd")="mon")+0)/1440
It checks every minute in a date range to determine if it falls on Monday (assuming you don't go out for a few seconds)
source share