How about this:
=SUMPRODUCT(--(OFFSET(Absence!$B$2:$B$62,0,MATCH($B10,Absence!$B$1:$E$1,0)-1)="H"),--(Absence!$A$2:$A$62>=$C$3),--(Absence!$A$2:$A$62<=$D$3))
Edited to add: That's looking for "H", not "S", because none of the cells in your example were set to "S", but it will count "S" cells just as well with a minor change (marked in bold)
Bookmarks