Count If with multiple criteria and unique values

dixon1983

Board Regular
Joined
Apr 23, 2005
Messages
175
Hi,
I dont know if this is possible or not but thought I'd ask anyway.

I have a sheet of data and want to run a count on the values in Column A with the following criteria:

- If the value in column B is repeated then the value in column A can only be counted once...
- Column C must equal 'M'.


Example:
A.....B.....C
1.....42....M
1.....42....M
2.....41....A
2.....41....M
1.....56....M


In this example 1 would be counted 2 times, and 2 would be counted once.

I have about 15 sheets of data like this and would like a master sheet to look into each sheet and give me a count of each so id prefer to not use the advanced filter => unique variables option if possible.

Any help would be greatly appreciated.

Dixon.
 
ok, sorry to keep beating a dead horse but what if i dont want to define the range and just do A:A. P:P, etc...?

Excel 2007 or later would allow that, but that would mean testing a terrible amount of irrelevant cells, affecting the performance adversely.
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi .. Can i ask one solution on the same topic

i have three columns of data as below

A.... B.... C....
MD1 X vs Y L
MD2 X vs Y L
MD2 X vs Y L

The output required is as below

I want to count unique values under column B with condition MD2 and L. For example in this case the output would be

A..... B.....
MD2 1

Any help is appreciated.

Sudi
 
Upvote 0
Hi .. Can i ask one solution on the same topic

i have three columns of data as below

A.... B.... C....
MD1 X vs Y L
MD2 X vs Y L
MD2 X vs Y L

The output required is as below

I want to count unique values under column B with condition MD2 and L. For example in this case the output would be

A..... B.....
MD2 1

Any help is appreciated.

Sudi

It's unclear what you have in those cells, in column A, B, and C. Care to specify exactly?
 
Upvote 0
Sorry but here you go with the information spread out.

Col ACol BCol C
MD1X vs YL
MD1X vs YL
MD1X vs YH
MD1X vs YL
MD2Y vs XL
MD2Y vs XH
MD2Y vs XL

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>

For example, on entering MD1 in cell D2, it should give me an output of 1 in E2. which is the count of unique value of Col B with conditions MD1 ( which is my input) and a fixed second criteria "L".


 
Upvote 0
Sorry but here you go with the information spread out.

Col A
Col B
Col C
MD1
X vs Y
L
MD1
X vs Y
L
MD1
X vs Y
H
MD1
X vs Y
L
MD2
Y vs X
L
MD2
Y vs X
H
MD2
Y vs X
L

<tbody>
</tbody>

For example, on entering MD1 in cell D2, it should give me an output of 1 in E2. which is the count of unique value of Col B with conditions MD1 ( which is my input) and a fixed second criteria "L".



F2: MD1

G2, control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($B$2:$B$8<>"",IF($C$2:$C$8="L",
  IF($A$2:$A$8=$F2,MATCH("~"&$B$2:$B$8,$B$2:$B$8&"",0)))),
  ROW($B$2:$B$8)-ROW($B$2)+1),1))
 
Upvote 0
Thanks Aladin, can i use the entire column as range or is it not advisable to do so. The data in source keeps adding in every day hence the question on using the entire column as range.
 
Upvote 0
Thanks Aladin, can i use the entire column as range or is it not advisable to do so.

Not advisable

[quote[The data in source keeps adding in every day hence the question on using the entire column as range.[/QUOTE]

Either (1) convert the range in A:C into a table or (2) create dynamic named ranges. For (2), we need the same and the type of data you heve in those columns.
 
Upvote 0
Hi - I tried figuring my problem, very similar to this thread, on my own but have been unsuccessful. Hoping someone can help out.

I am trying to check for country in Column A and get count of values in column B after removing possible "#N/A" in column B. I also, need final count from column B that excludes any repeats. For data below, my final count from column B for each unique country in column A should be just 1 after removing #N/A and duplicates from column B

Asia0582.HK
AustraliaARWDA.AX
AustraliaARWDA.AX
AustraliaARWDA.AX
Europe#N/A
Europe#N/A
Europe#N/A
EuropeCFTM.PA
EuropeCFTM.PA

<colgroup><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,847
Messages
6,127,264
Members
449,372
Latest member
charlottedv

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