I have this formula so far
=COUNTIF((IF(B1:B5,COUNTIFS(B1:B5,"A",C1:C5,"apple"),COUNTIFS(A1:A5,"A",C1:C5,"apple"))),">=1")

for given table:
A B C
1 A apple
2 B apple
3 B A apple
4 B apple
5 A B apple

I expect the answer to be 2 but it gives me a #Value error.