COUNTIF with two Variables?

60614_Excel

Board Regular
Joined
Jan 5, 2003
Messages
55
Hi, I am trying to do a COUNTIF based on two different variables. Basically in Column A I have an animal type and in column B I have the # of animals. So, I want to COUNTIF Col A = DOG and if COL B > 0.

I tried to do a COUNTIF(AND(... but I keep getting errors. Any ideas? Thanks in advance!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
On 2003-01-20 12:08, 60614_Excel wrote:
Hi, I am trying to do a COUNTIF based on two different variables. Basically in Column A I have an animal type and in column B I have the # of animals. So, I want to COUNTIF Col A = DOG and if COL B > 0.

I tried to do a COUNTIF(AND(... but I keep getting errors. Any ideas? Thanks in advance!

=sumproduct((range="animal")*(range>0))
 
Upvote 0
Could this be adapted easily?
I would like to sum two different columns if they're both true. For example I have a list of disease types and I have converted this into a frequency table using COUNTIF. I also have a column with the labels "ELIGIBLE" and "NOT ELIGIBLE". I would like to be able to sum the number of people in total which worked with

=COUNTIF($KD$2:$KD$208,"Diabetes")

And I would like to know how many of these people are eligible =, i.e. satisfying the criteria of "Diabetes" in one column and "ELIGIBLE" in another. I thought that the following would work:

=COUNTIF($KD$2:$KD$208,"Diabetes")AND($KC$2:$KC$208,"ELIGIBLE")

but no joy - am I doing something silly?

Matt
 
Upvote 0

Forum statistics

Threads
1,215,048
Messages
6,122,862
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top