Google-sheets – countif but not empty cells

formulasgoogle sheetsgoogle-sheets-arrayformula

Can I make this formula not count empty cells?

={"Score"; INDEX(if(len(A2:A), countif(if(REGEXEXTRACT(C2:BE,"(?i)yes")="yes", row(C2:C)), row(C2:C)),))}

Best Answer

Please use the following simple, still improved formula

={"Score"; 
   INDEX(IF(IF(LEN(B2:B), 
                COUNTIF(IF(REGEXEXTRACT(D2:G,"(?i)yes")="yes", ROW(D2:D)), ROW(D2:D)),)=0,"",
            IF(LEN(B2:B), 
                COUNTIF(IF(REGEXEXTRACT(D2:G,"(?i)yes")="yes", ROW(D2:D)), ROW(D2:D)),)))}

enter image description here

You will notice it is the same formula given before only this time we use an extra IF for when the result =0