Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|improve this answer

Answered I received in the Google Support Forum:

=counta(iferror(filter(B:B,A:A="name1",B:B="yes")))
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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