'Excel INDEX MATCH COUNTIF

I know this is very simple, but I'm quite stuck on that. I have a very simple file with the following columns: enter image description here

I need to count how many people have chosen the fruit specified in column C. I tried to do something like

=INDEX($B$1:$B$8,MATCH("*"&$C1&"*",$A$1:$A$8,0))

And it correctly finds the first person corresponding to a given fruit, but how to make it count the total number of people? I've tried using countif, but I'm missing something...



Solution 1:[1]

I hope this helps

=COUNTIF(A1:A8,"*apple*")

and if you want to use the cell as a reference

=COUNTIF($A$1:$A$8,"*"&C1&"*")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 trincot