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.
 
So this is an example of what I'm looking for - the Unique Contacts column on the right. I am agnostic about which of a series of contacts in the same month is considered "unique" - it can be first, last, or something in the middle, it really doesn't matter. For some reason the 0's were eliminated from the table, but wherever you see blank cells, those are 0's.

Does this make more sense?

Thanks!
 
Last edited:
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Like this?


Excel 2010
ABCDE
1EntityContactMonthAssociateUnique Contact
23396129395Bar, J 
333983133516Bar, J1
43398313356Amo, M
533983133516Amo, M
63398313356Amo, M
733910212614Bar, J1
83395940674Amo, M
933959406716Amo, M1
103395912355Bar, J
113391001994Amo, M
1233927939011Bar, J1
1333927939011Bar, J
1433927939014Med, M1
1533913874611Bar, J1
1633945924811Mer, D1
1733945924811Mer, D
183394592481Mer, D
193394592483Mer, D
2033945924813Zim, C1
2133945924813Zim, C
223394592484Amo, M
233394592484Amo, M
2433945924814Amo, M1
Sheet1
Cell Formulas
RangeFormula
E2=IF(B2<>1,"",IF(COUNTIFS(A$1:A2,A2,B$1:B2,1,C$1:C2,C2)>1,"",1))


and copy E2 down.
 
Upvote 0
Looks like it works perfectly! Thank you! If I change the order within columns, such as sorting by month or associate, rather than entity, will that affect the results in the Unique Contacts column?
 
Upvote 0
Only in that it flags the first contact in the column, so you may get 1s in different places.
 
Upvote 0
Is there a way to control for that and avoid potentially putting 1's in the wrong places? By default I intend to sort by month (most recent to oldest).
 
Upvote 0
How would they be wrong? It would still be the first contact for that Associate / Month / Entity combination, it just might appear in a different row based on your sorting.
 
Upvote 0
[TABLE="class: grid, width: 300, align: left"]
<tbody>[TR]
[TD]Product[/TD]
[TD]Size[/TD]
[TD]result[/TD]
[/TR]
[TR]
[TD]configurable[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]simple[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]simple[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]configurable[/TD]
[TD][/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]simple[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]simple[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]simple[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]simple[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]configurable[/TD]
[TD][/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]simple[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]configurable[/TD]
[TD][/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]


Dear All,
this my problem at hand
i can use countif simple & return the value here
but i need is it should return the values between two texts in coloumn (i.e confifgurable)
it should count how many times the text simple is present between two configurable texts

regards
PVR Ramana
 
Last edited by a moderator:
Upvote 0
C2, copied down:
Rich (BB code):

=IF(A2="configurable",IF(COUNTIFS($A$1:A2,A2)>1,
    COUNTIFS(INDEX($A$1:A1,LOOKUP(9.99999999999999E+307,1/($A$1:A1="configurable"),
    ROW($A$1:A1)-ROW($A$1)+1)):A2,"simple"),""),"")
 
Upvote 0

Forum statistics

Threads
1,223,933
Messages
6,175,481
Members
452,647
Latest member
MatthewBiersay

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