Hello I'm struggling to search for the right answer to this, and I'm sure it's simple but could do with some help please!
I have a set of data where I want to count the number of times the something comes up (lets say a list of animals), and multiple sizes e.g.
I now want to count say, dogs that are large and medium only.
This works: =sum(countifs(A2:A9,"Dog",B2:B9,{"large", "medium"}))
However how do I get the formula to refer to cells for the size of the animal; i.e. lets say the words "Large" and "Medium" were in C1 and C2 respectfully, this formula doesn't work:
=sum(countifs(A2:A9,"Dog",B2:B9,{C1,C2}))
Any help would be much appreciated!
Thanks
I have a set of data where I want to count the number of times the something comes up (lets say a list of animals), and multiple sizes e.g.
Animal | Size |
Pig | Very small |
Pig | Small |
Dog | Large |
Dog | Medium |
Cat | Small |
Dog | Small |
Mouse | Medium |
Deer | Small |
I now want to count say, dogs that are large and medium only.
This works: =sum(countifs(A2:A9,"Dog",B2:B9,{"large", "medium"}))
However how do I get the formula to refer to cells for the size of the animal; i.e. lets say the words "Large" and "Medium" were in C1 and C2 respectfully, this formula doesn't work:
=sum(countifs(A2:A9,"Dog",B2:B9,{C1,C2}))
Any help would be much appreciated!
Thanks