Count if

Imran Azam

Board Regular
Joined
Mar 15, 2011
Messages
103
HI Guys

i have the data below


[TABLE="width: 274"]
<colgroup><col span="2"><col><col></colgroup><tbody>[TR]
[TD]group [/TD]
[TD]ID[/TD]
[TD]Department[/TD]
[TD]products [/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD="align: right"]1[/TD]
[TD]sales [/TD]
[TD]pc[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD="align: right"]2[/TD]
[TD]marketing[/TD]
[TD]pc[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD="align: right"]3[/TD]
[TD]marketing[/TD]
[TD]ons[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD="align: right"]4[/TD]
[TD]HR[/TD]
[TD]pc[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD="align: right"]5[/TD]
[TD]marketing[/TD]
[TD]tons[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD="align: right"]6[/TD]
[TD]marketing[/TD]
[TD]pc[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD="align: right"]7[/TD]
[TD]sales [/TD]
[TD]pc[/TD]
[/TR]
</tbody>[/TABLE]


I want to do a count if , using this logic , count the ID where Group = A, department is not 'sales' and product is not 'tons' or 'ons' ( basically i want to exclude the product ons and tons in the count)

so the answer should be 3

can this be done?

thanks for any help

****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="width: 274"]
<tbody>[TR]
[TD]tons[/TD]
[/TR]
</tbody>[/TABLE]
</body>
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Re: Count if help

Something like this?

=COUNTIFS(A2:A8, "A", C2:C8, "<>" & "Sales", D2:D8, "<>" & "ons", D2:D8, "<>" & "tons")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,901
Messages
6,175,277
Members
452,629
Latest member
SahilPolekar

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