=SUM((FREQUENCY(IF(B2:M2>0,COLUMN(B2:M2)),IF(B2:M2<=0,COLUMN(B2:M2)))>0)*1)
try this array formula(Shift+Ctrl+Enter) and copy towards down