# Multiple Functions

#### robstark

##### New Member
I have 2 columns and I need the formula to read column "A" first and if it meets a certain criteria to look at column "B" and count if there's any text in the cells. See the example to show what I'm looking for. I would want the formula to look at column a for pet type (e.g. dog) and then look at owner's name (any text in that column gets counted) and give me the sum (in this case 3). I've tried a couple of things and I'm running out of time.

Example:
 Pet Type Owner's Name dog dog John dog dog Jane dog Dan cat Mollie cat Mary cat cat Scott bird George bird fish Bill fish fish Betty

<colgroup><col><col></colgroup><tbody>
</tbody>

Thanks as always!

Last edited by a moderator:

#### Jonmo1

##### MrExcel MVP
Which version of Excel are you using?

XL2007+ Try
=COUNTIFS(A2:A15,"Dog",B2:B15,"<>")

#### My Aswer Is This

##### Well-known Member
Try this:
This formula assumes your data is in cells A1:A20 and B1:B20
Put this formula in cell D1.
Put the word "Dog" in cell C1
You can modify the formula if you like.
Optional:
You can take the formula in cell D1 and fill it down.
Then put "Cat" in cell C2 and so on if you like.
Code:
=COUNTIFS(\$A\$1:\$A\$20,C1,\$B\$1:\$B\$20,"<>")

#### robstark

##### New Member
jonmo- I tried this one but I got a value error- I must be missing something.

#### robstark

##### New Member
My Answer Is This- This one worked great! Thank you very much!