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.
 
I think your asking if Column B has more than just MACCL1 & MACCK, that is Yes. There are 12 types in column B, I only want those unique to MACCL1 And MACCK. The column for my current data set is 24307 rows.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I think your asking if Column B has more than just MACCL1 & MACCK, that is Yes. There are 12 types in column B, I only want those unique to MACCL1 And MACCK. The column for my current data set is 24307 rows.

I was asking whether you would impose more than 2 criteria at the same time, say MACCL1, MACKK, MACCT for example?
 
Upvote 0
And, what is wrong with this formula? I want Unique count from Q, of MACCK in AP, But only if CD = Y. As is I get #N/A. What am I missing, where?

=SUM(IF(FREQUENCY(IF(1-($Q$6:$Q$24301=""),IF($CD6:$CD$24301="Y",IF($AP$6:$AP$24301="MACCK",MATCH($Q$6:$Q$24301,$Q$6:$Q$24301,0))),ROW($Q$6:$Q$24301)-ROW($Q$6)+1),1),0))
 
Upvote 0
And, what is wrong with this formula? I want Unique count from Q, of MACCK in AP, But only if CD = Y. As is I get #N/A. What am I missing, where?

=SUM(IF(FREQUENCY(IF(1-($Q$6:$Q$24301=""),IF($CD6:$CD$24301="Y",IF($AP$6:$AP$24301="MACCK",MATCH($Q$6:$Q$24301,$Q$6:$Q$24301,0))),ROW($Q$6:$Q$24301)-ROW($Q$6)+1),1),0))

Control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(1-($Q$6:$Q$24301=""),IF($CD6:$CD$24301="Y",IF($AP$6:$AP$24301="MACCK",MATCH($Q$6:$Q$24301,$Q$6:$Q$24301,0)))),ROW($Q$6:$Q$24301)-ROW($Q$6)+1),1),0))
 
Upvote 0
Equal both, not equal either or... Do you ever have more than two such criteria?

I think your asking if Column B has more than just MACCL1 & MACCK, that is Yes. There are 12 types in column B, I only want those unique to MACCL1 And MACCK. The column for my current data set is 24307 rows.

I was asking whether you would impose more than 2 criteria at the same time, say MACCL1, MACKK, MACCT for example?

Potentially that may be required, or a variable from another column.

In case of two...

Row\Col
A​
B​
C​
D​
1​
GPIXMACCL1
2​
01100040100315MACCL1MACCK
3​
01100040100315MACCK
2​
4​
01200010100105MACCL1
5​
01200010100110MACCL1
6​
01200010100110MACCK
7​
01200010100303MACCK

In D3 control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF(ISNUMBER(MATCH(IF($B$2:$B$7=D2,$A$2:$A$7,"#"),
    IF($B$2:$B$7=D1,$A$2:$A$7),0)),MATCH($A$2:$A$7,$A$2:$A$7,0)),
    ROW($A$2:$A$7)-ROW($A$2)+1),1))
 
Upvote 0
Awesome! Got it, and the follow up I sent where the variable is Y.
Thanks so much for your expertize!!!!!
 
Upvote 0
Variable Y from post #275 above, the extra parin did not work, but this did. With L1 being Y.
=SUM(IF(FREQUENCY(IF(ISNUMBER(MATCH(IF($AP$6:$AP$24301=K2,$Q$6:$Q$24301,"#"),IF($CD$6:$CD$24301=L1,$Q$6:$Q$24301),0)),MATCH($Q$6:$Q$24301,$Q$6:$Q$24301,0)),ROW($Q$6:$Q$24301)-ROW($Q$6)+1),1))

Thanks Again!
 
Upvote 0
Variable Y from post #275 above, the extra parin did not work, but this did. With L1 being Y.
=SUM(IF(FREQUENCY(IF(ISNUMBER(MATCH(IF($AP$6:$AP$24301=K2,$Q$6:$Q$24301,"#"),IF($CD$6:$CD$24301=L1,$Q$6:$Q$24301),0)),MATCH($Q$6:$Q$24301,$Q$6:$Q$24301,0)),ROW($Q$6:$Q$24301)-ROW($Q$6)+1),1))

Thanks Again!

No wonder. I did not take the question of post #275 as the same question I have answered in post #276 at all!...
 
Upvote 0

Forum statistics

Threads
1,217,389
Messages
6,136,317
Members
450,003
Latest member
AnnetteP

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