Help with Countif Formula

znxm0i

New Member
Joined
May 27, 2014
Messages
29
Hi all,

I need to be able to count the number of "yes" entries in a cell based on whether another cell contains a specific text. Here's my scenario:

I have a tab called raw data that contains columns called: ID#, Title, Internal, Name, Location, Unit
I want to count the number of "yes" entries in the Internal column that correspond with a particular Unit
For example, if Unit = "IOS" then find all "yes" entries in the Internal column for only "IOS" and give me the total count

I've been trying to use the following formula but it doesn't work, instead it's counting both the specific instances in the Unit and Internal column and summing the count.

Thank you.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Never mind all,

I figured it out by using the below formula:

=COUNTIFS($T$4:$T$136,"=IOS",$O$4:$O$136,"=Yes")

I wasn't putting the equal signs in front of the criteria
 
Last edited:
Upvote 0
You don't actually need the equal signs at all, in this case, i.e.
Code:
[COLOR=#333333]=COUNTIFS($T$4:$T$136,"IOS",$O$4:$O$136,"Yes")[/COLOR]
 
Upvote 0
You don't actually need the equal signs at all, in this case, i.e.
Code:
[COLOR=#333333]=COUNTIFS($T$4:$T$136,"IOS",$O$4:$O$136,"Yes")[/COLOR]


Thank you :)

I have another question related to this issue. I have the below formula in my spreadsheet but what I'd want to do is tell it to display the number zero for those cells that don't have a value in rows T4:T136. I think that I would use an IF statement but I haven't been able to get it to work because I'm not really sure where to place it. Can you help?

=AVERAGEIF('Raw Data'!$T$4:$T$136, "Commercial", 'Raw Data'!$U$4:$U$136)
 
Upvote 0
Try this:
Code:
=[COLOR=#0000ff]IF(COUNTA('Raw Data'!$T$4:$T$136)=0,0,[/COLOR][COLOR=#333333]AVERAGEIF('Raw Data'!$T$4:$T$136, "Commercial", 'Raw Data'!$U$4:$U$136)[/COLOR][COLOR=#0000ff])[/COLOR]

Or, if you really want to check not just for any text, but rather "Commercial", then use:
Code:
=[COLOR=#0000ff]IF(COUNTIF('Raw Data'!$T$4:$T$136,"Commercial")=0,0,[/COLOR][COLOR=#333333]AVERAGEIF('Raw Data'!$T$4:$T$136, "Commercial", 'Raw Data'!$U$4:$U$136)[/COLOR][COLOR=#0000ff])[/COLOR]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,094
Latest member
teemeren

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