Formula to identify if for a unique identifier there is more than one value in another column

vanbooth

New Member
Joined
Apr 3, 2017
Messages
15
I have two columns of data, one contains a unique identifier, the other contains another 4 digit key.

What I want to do is for the unique identifier when there is more than one 4 digit key that is associated to it, I would like to to display x. Marking both entries not just the first or second. For example:

4 digit KeyUnique IdentifierDuplicate
PL01AB
BE01ABC
BE01ABCD
BE01ABCDEx
FR05ABCDEx
BE01ABCDEFx
GB30ABCDEFx
GB30ABCDEFG
PL01ABCDEFGH
GB30ABCDEFGHIx
PL01ABCDEFGHIx

<tbody>
</tbody>


Does anyone have any suggestions for how to best tackle this?

TIA
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
How about this?


Excel 2016 (Windows) 32 bit
ABC
1PL01AB 
2BE01ABC
3BE01ABCD
4BE01ABCDEx
5FR05ABCDEx
6BE01ABCDEFx
7GB30ABCDEFx
8GB30ABCDEFG
9PL01ABCDEFGH
10GB30ABCDEFGHIx
11PL01ABCDEFGHIx
Sheet1
Cell Formulas
RangeFormula
C1=IF(COUNTIF($B$1:$B$11,B1)>1,"x","")
 
Upvote 0
How about this?

Excel 2016 (Windows) 32 bit
ABC
1PL01AB
2BE01ABC
3BE01ABCD
4BE01ABCDEx
5FR05ABCDEx
6BE01ABCDEFx
7GB30ABCDEFx
8GB30ABCDEFG
9PL01ABCDEFGH
10GB30ABCDEFGHIx
11PL01ABCDEFGHIx

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
C1=IF(COUNTIF($B$1:$B$11,B1)>1,"x","")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>


Just tried it and not working :(

I need it to look at column B (the same value may be listed in column B more than once) and then see if in A there is more than one entry associated too it.

So for example if in column B you see ABCD and in column A it is linked to 1234 but also linked to 4321 I need it to put an x beside both in column C.

Thanks so much for the help!!
 
Upvote 0
Yes, I thought you might say something like that ... You see, the thing is, I can only provide a solution based on the data sample you provide. If that isn't adequate, then you need to provide a set that is realistic and reflects your real data set-up. Once you've done that, I'll take another look.
 
Upvote 0
Yes, I thought you might say something like that ... You see, the thing is, I can only provide a solution based on the data sample you provide. If that isn't adequate, then you need to provide a set that is realistic and reflects your real data set-up. Once you've done that, I'll take another look.


Here is a more accurate data set:


Key
ConcatenateDUPLICATE
BE01ILD-S1933-UTZ-0002341223412
BE01ISW-K6138-SPT-0001902019020
BE01YPW-F120001-05-00011871187
BE01YYD-A16NH-UTZ-000132248367
FR05CHD-Q15NOP-UTZ-0001523431162
BE01BAK-D1NV-0002341223412
BE01CHD-Q70SDO-0005611756117x
FR05CHD-Q70SDO-0005611756117x
BE01CHD-T6436-UTZ-00089261313
BE01CHD-U2431-UTZ-0001024157
BE01CHD-U4830NVUTZ-0002937629376
BE01CHD-U5431BO2FT-000102446755
BE01CHD-V9124-000102446755
BE01CHM-U23S-00030903090x
GB30CHM-U23S-00030903090x
GB30CHM-V8071-000375766100
GB30CHM-W8069-000375766100
GB30CVW-U16USP-NES-00030903090x
PL01CVW-U16USP-NES-00030903090x
GB30CVW-U16USP-NES-000390016545x
PL01CVW-U16USP-NES-000390016545x
GB30FAIR-M4GB-0004701918221
GB30FAIR-M4GB-0004701939911

<colgroup><col><col><col></colgroup><tbody>
</tbody>


Thank you!!!!
 
Upvote 0
This is not a more representative set, because my formula is working on this list, too. See below - my formula has been added to column D:

Excel 2016 (Windows) 32 bit
ABCD
1BE01ILD-S1933-UTZ-0002341223412
2BE01ISW-K6138-SPT-0001902019020
3BE01YPW-F120001-05-00011871187
4BE01YYD-A16NH-UTZ-000132248367
5FR05CHD-Q15NOP-UTZ-0001523431162
6BE01BAK-D1NV-0002341223412
7BE01CHD-Q70SDO-0005611756117xx
8FR05CHD-Q70SDO-0005611756117xx
9BE01CHD-T6436-UTZ-00089261313
10BE01CHD-U2431-UTZ-0001024157
11BE01CHD-U4830NVUTZ-0002937629376
12BE01CHD-U5431BO2FT-000102446755
13BE01CHD-V9124-000102446755
14BE01CHM-U23S-00030903090xx
15GB30CHM-U23S-00030903090xx
16GB30CHM-V8071-000375766100
17GB30CHM-W8069-000375766100
18GB30CVW-U16USP-NES-00030903090xx
19PL01CVW-U16USP-NES-00030903090xx
20GB30CVW-U16USP-NES-000390016545xx
21PL01CVW-U16USP-NES-000390016545xx
22GB30FAIR-M4GB-0004701918221
23GB30FAIR-M4GB-0004701939911

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D1=IF(COUNTIF($B$1:$B$23,B1)>1,"x","")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
This is not a more representative set, because my formula is working on this list, too. See below - my formula has been added to column D:

Excel 2016 (Windows) 32 bit
ABCD
1BE01ILD-S1933-UTZ-0002341223412
2BE01ISW-K6138-SPT-0001902019020
3BE01YPW-F120001-05-00011871187
4BE01YYD-A16NH-UTZ-000132248367
5FR05CHD-Q15NOP-UTZ-0001523431162
6BE01BAK-D1NV-0002341223412
7BE01CHD-Q70SDO-0005611756117xx
8FR05CHD-Q70SDO-0005611756117xx
9BE01CHD-T6436-UTZ-00089261313
10BE01CHD-U2431-UTZ-0001024157
11BE01CHD-U4830NVUTZ-0002937629376
12BE01CHD-U5431BO2FT-000102446755
13BE01CHD-V9124-000102446755
14BE01CHM-U23S-00030903090xx
15GB30CHM-U23S-00030903090xx
16GB30CHM-V8071-000375766100
17GB30CHM-W8069-000375766100
18GB30CVW-U16USP-NES-00030903090xx
19PL01CVW-U16USP-NES-00030903090xx
20GB30CVW-U16USP-NES-000390016545xx
21PL01CVW-U16USP-NES-000390016545xx
22GB30FAIR-M4GB-0004701918221
23GB30FAIR-M4GB-0004701939911

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D1=IF(COUNTIF($B$1:$B$23,B1)>1,"x","")

<tbody>
</tbody>

<tbody>
</tbody>


Sorry that's not working either. I feel like it needs to reference A or else how will it identify that the CONCAT has two Keys from Column A associated too it?
 
Upvote 0
In what way is it 'not working'? It produces the exact same results as you have shown above! Unless you give me a set of data that will not work using the formula I have already supplied, then I can't help you.
 
Upvote 0
Just tried it and not working :(

I need it to look at column B (the same value may be listed in column B more than once) and then see if in A there is more than one entry associated too it.

So for example if in column B you see ABCD and in column A it is linked to 1234 but also linked to 4321 I need it to put an x beside both in column C.

Thanks so much for the help!!

Your original post shows ABCD in column B just once and there are no 1234 and 4321 in column A which are associated with it... Such would be needed in order to constrain any solution.
 
Last edited:
Upvote 0
When I copy and paste the formula into a new sheet to test it with the same data set it provides an 'x' for all the data.

I think this is because it does not appear to be referencing column A at all. It needs to lookup the value in column A from the value in column B to see if two values found in column A. If two values are found it needs to identify in column C beside both entries with an x. If the value in column B has only one corresponding value in column A it should be blank.

Does that help explain better?

TIA
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,212
Members
449,214
Latest member
mr_ordinaryboy

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