4

I am having trouble writing a function for this need (in Google spreadsheets):

I have 2 columns A and B.

I want to be able to get a percentage based on those two columns. I want to count the number of times a specific value is found in A and only if B has a certain value in it.

Example:

  A       B
name1    yes
name2    no
name7    no
name1    yes
name1    no
name2    yes

I would like to function to only give me the percentage of times name1 is found when it is associated with a yes in column B.

If you need any more information and clarification, let me know.

4

Answered I received in the Google Support Forum:

=counta(iferror(filter(B:B,A:A="name1",B:B="yes")))
0

With the A value (eg "name1") held in say C1 and the B value (eg "yes") in say D1 then:

=COUNTIFS(A:A,C1,B:B,D1)  

is shorter and more versatile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.