Google Spreadsheet, Count IF contains a string
I have a column like this:
What devices will you be using?
iPad
Kindle & iPad
No Tablet
iPad
iPad & Windows
How do I count the amount of people that said iPad?
This formula does work for exact matches but not if it contains an additional value:
=(COUNTIF(A2:A51,"=iPad")/COUNTA(A2:A51))*1
Any Suggestions?
It will likely have been solved by now, but I ran accross this and figured to give my input
=COUNTIF(a2:a51;"*iPad*")
The important thing is that separating parameters in google docs is using a ;
and not a ,
In case someone is still looking for the answer, this worked for me:
=COUNTIF(A2:A51, "*" & B1 & "*")
B1
containing the iPad
string.
You should use
=COUNTIF(A2:A51, "*iPad*")/COUNTA(A2:A51)
Additionally, if you wanted to count more than one element, like iPads OR Kindles, you would use
=SUM(COUNTIF(A2:A51, {"*iPad*", "*kindle*"}))/COUNTA(A2:A51)
in the numerator.
Try using wildcards directly in the COUNTIF function :
=(COUNTIF(A2:A51,"=*iPad*")/COUNTA(A2:A51))*1