Using COUNTIF Formula with Reference and Array in Google Sheets

google sheets

Here's a copy of the Google Sheets I'm working on and here's what I'm trying to do:

I need a COUNTIF formula that would count as 1 if the sum from columns R to AD in the Failed sheet is less than 8. There are five potential responses to columns R to AD and each is assigned a weight:

0 - Not at all  
1 - To a slight degree 
2 - To a moderate degree 
3 - To a great degree 
4 - All the time

Based on the current data, row 30 in the Reports sheet should count as 2.

But how do I do that?

Best Answer

It looks like the correct countif formula is in your reports sheet right now - but in answer to your comment - if you want to simplify that huge if statement, you can use arrayformula, and vlookup or substitute to trim the formula to this:

=if(istext(B2), SUM(ARRAYFORMULA(VLOOKUP(R2:AD2,{"Not at all",0;"To a slight degree",1;"To a moderate degree",2;"To a great degree",3;"All the time",4},2,FALSE))),)

for my example i gave it a short lookup table, but i included it as a literal array so that you dont have to create a helper column

enter image description here

or

enter image description here