Check if each customer has a unique ID

swapnilk

Board Regular
Joined
Apr 25, 2016
Messages
75
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi,

So i have data in two columns as under:
I want to check whether each Customer ID is unique for a Customer Name. For eg in below table False is returned because the Customer Name "DD" already had Customer ID "4". I am using this formula to check

=IF(COUNTIF($B$2:$B$39792,B2)=1,SUMPRODUCT(--(($A$2:$A$39792=A2)*(COUNTIF($B$2:$B$39792,$B$2:$B$39792))>1))=0,COUNTIFS($B$2:$B$39792,B2,$A$2:$A$39792,"<>"&A2)=0)

but the problem is that it takes a lot of time for 39,792 rows, i sometimes will have more then 300,000 rows and it takes hours. Can someone please help me with a faster way to find whether same Customer Name have been given multiple Customer IDs.

Customer IDCustomer NameCheck if ID is repeated
1ATrue
2BTrue
3CTrue
4DDTrue
5DDFalse
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi,

If I understand correctly, see how this works out for you:

Book3.xlsx
ABC
1Customer IDCustomer NameCheck if ID is Unique
21ATRUE
32BTRUE
43CTRUE
54DDTRUE
65DDFALSE
76BFALSE
87DDFALSE
98DTRUE
Sheet1016
Cell Formulas
RangeFormula
C2:C9C2=COUNTIF(B$2:B2,B2)=COUNTIFS(A$2:A2,A2,B$2:B2,B2)
 
Upvote 0
The above would appear to suggest that the first pairing is always the desired unique?

If so, is there any value in using the below to directly create a revised list of unique pairings?
Book1
ABC
1I/DNameCorrect I/D
21A1
32B2
43C3
54DD4
65DD4
71A1
82B2
92B2
103c3
112B2
12999Z999
1322DD4
144DD4
15222Z999
16 
Sheet2
Cell Formulas
RangeFormula
C2:C16C2=IFERROR(IF(INDEX(A:A,MATCH(B2,B:B,0))=A2,A2,INDEX(A:A,MATCH(B2,B:B,0))),"")
 
Upvote 0
The above would appear to suggest that the first pairing is always the desired unique?

If so, is there any value in using the below to directly create a revised list of unique pairings?
Book1
ABC
1I/DNameCorrect I/D
21A1
32B2
43C3
54DD4
65DD4
71A1
82B2
92B2
103c3
112B2
12999Z999
1322DD4
144DD4
15222Z999
16 
Sheet2
Cell Formulas
RangeFormula
C2:C16C2=IFERROR(IF(INDEX(A:A,MATCH(B2,B:B,0))=A2,A2,INDEX(A:A,MATCH(B2,B:B,0))),"")
Thanks for the reply.

But i just need to find out whether each customer has been given a unique ID or multiple IDs have been given for the same customer. Then a decision has to be taken on which Customer ID to keep (it might not always be that the lowest number ID will be assigned to the customer), this will have to be a manual process.
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,215,053
Messages
6,122,882
Members
449,097
Latest member
dbomb1414

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