Identify ID’s with 2 or more instances of an event

Kazlik

Board Regular
Joined
Dec 9, 2014
Messages
68
I am looking for the most efficient way to do the following.

I have up to 10 different CodeID's that can be associated one or many times to an ID. I need to identify ID's that have 2 or more instances of the same CodeID. In the sample below ID 1 should be identified as it has two instances of CodeID 50.

ID CodeID
1 123
1 24
1 50
1 102
1 24
1 18
2 50
2 123
2 24
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Did you mean to say 2 instances of 24 (not 50)? If so, enter this in C2 and copy down, then do an AutoFilter on Col C to exclude 1's:
Code:
=COUNTIFS(A:A,A2,B:B,B2)
 
Upvote 0
Sorry about that, yes I meant 24. I would like to do this in PowerPivot and have it working using the below but suspect there is an easier way.

=IF ( CALCULATE(DISTINCTCOUNT(Sheet1[CodeID]),FILTER(Sheet1,Sheet1[ID]=EARLIER(Sheet1[ID]))) <> CALCULATE(COUNT(Sheet1[CodeID]),FILTER(Sheet1,Sheet1[ID]=EARLIER(Sheet1[ID]))) ,"yes", "no")
 
Upvote 0
I might have written it slightly different, based on style prefs, but functionally, I would have done the same. I can't think of an easier way.
 
Upvote 0

Forum statistics

Threads
1,224,074
Messages
6,176,216
Members
452,715
Latest member
DebbieCox

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