Home > Mobile >  Count if "Yes" Google Sheets condition
Count if "Yes" Google Sheets condition

Time:06-18

Hi everyone this question could a little confusing I have a survey and in this one, there is Yes/No questions I'm counting the answers by questions like in the image above, but I want to make a conditional count like as example if someone from the survey answer yes and there is a conditional question related to that like Are you happy? and there is a mix of answers as example 5 yes and 2 nos gives a total of 7 inputs then the second question if you are happy why are you happy? and from the 5 yes we receive 4 answers I want to count the second question only if the first answers was yes, I have this formulas that make that in a split version:

=(COUNTIF(A2:A13,"?*") COUNT(A2:A13)) # Gives a total of 4

Then if this total is bigger than Zero =IF(H2>0,1,"") with this for each row I have 1 input as example.

But if one of the first questions was Yes I want to count the second question and this is were I get lost.

I would like to mix the both formulas in just one cell. like this:

=IF(Resultofcounts > 0 , 1, "")                   #Resultofcounts= (COUNTIF(A2:A13,"?*") COUNT(A2:A13))

Some help please!

enter image description here

CodePudding user response:

unless I miss something:

=ARRAYFORMULA(IF(B3:F7="",,1))

enter image description here


update:

=INDEX({
 IF(TRIM(FLATTEN(QUERY(TRANSPOSE(B3:E8),,9^9)))="",,1), 
 IF(TRIM(FLATTEN(QUERY(TRANSPOSE(F3:G8),,9^9)))="",,1)})

enter image description here

  • Related