Home > database >  Google Sheet: Exclude a row from counting based on value of another column
Google Sheet: Exclude a row from counting based on value of another column

Time:01-14

I have a Google sheet as follows:

enter image description here

I am counting all "yes" in column B based on the formula =COUNTIF(B2:B6,"Yes"). However, I would like to exclude row 5 based on the value "EXCLUDE" in column A.

How can I perform such filtering?

CodePudding user response:

you can try either:

=COUNTIFS(B2:B6,"Yes",A2:A6,"<>"&"EXCLUDE")

OR

=COUNTA(IFNA(FILTER(B:B,B:B="yes",A:A<>"EXCLUDE")))

CodePudding user response:

try:

=SUMPRODUCT(B2:B6="yes"; A2:A6<>"exclude")
  • Related