how about
for 2
=SUM(IF(FREQUENCY(IF(D4:p4="OFF",COLUMN(D4:p4)),IF(D4:p4<>"OFF",COLUMN(D4:p4)))=2,1))
for 4
=SUM(IF(FREQUENCY(IF(D4:p4="OFF",COLUMN(D4:p4)),IF(D4:p4<>"OFF",COLUMN(D4:p4)))=4,1))
Not sure what version of excel you have - but may need
CONTROL+SHIFT+ENTER..
Just change the number 2 to 4 to mark the amount you want
=SUM(IF(FREQUENCY(IF(D4:p4="OFF",COLUMN(D4:p4)),IF(D4:p4<>"OFF",COLUMN(D4:p4)))=2,1))
NOT sure it will work for all possible
the face is : and a P
so D4 : P4
Moderator note: You could use Inline code to avoid that.