A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Formula in cell 21:
=COUNT(IF($C$5:$J$17<>"",IF($B21=$C$4:$J$4,$C$5:$J$17,""),""))
Formula in cell D21:
=COUNT(IF($C$5:$J$17<>0,IF($B21=$C$4:$J$4,$C$5:$J$17,""),""))
Enter as array formula if not using Excel 365.
Regards,
Amit Tandon