Formula to find the same duplicate values in multiple columns

mehulatree

New Member
Joined
Jun 15, 2015
Messages
3
Hi,

I have some data wherein, I wish to create groups out of the same. The logic behind the groups is that if multiple columns have the same number present, they form a group.

In the example,
Group A: Column 1 ("1" is not present in any other columns)
Group B: Columns 2-18 ("11" and "12" are present in all these columns)
Group C: Columns 19-22 ("20" is present in all these columns)
Group D: Column 23 ("23" is not present in any other columns)
Group E: Columns 24-25 ("24" and "25" are present in all these columns)
Group F: Column 26 ("26" is not present in any other columns).

The first step towards getting this answer (the eventual aim is to form groups for any number of rows, columns and values), is to get a formula that checks if a particular number is common in ALL the columns of the selected range.

I will be grateful if someone can help me with the formula/<acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help;">VBA</acronym> code required towards reaching my eventual aim.

Thanks in advance!


1234567891011121314151617181920212223242526
3222222222233771111201920202524
4433333333344881212212221
555444444445599131322
666655555556610101414
777776666667711111515
888888777778812121616
999999988889913131817
101010101010101099910101414
111111111111111111101011111615
121212121212121212121112121717
1313131313131313131314131818
141414141414141414141515
1515151515151616
1616161616161717
17171818
1818

<tbody>
</tbody>
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi mehulatree

If you want to check how many of the columns contain a particular number, you can use a slightly adjusted version of XOR LX's array formula as follows (use control+shift+enter):

=SUM(IF(MMULT(TRANSPOSE(N(IFERROR($A$1:$Z$17=AE1, 0))), (ROW($A$1:$A$17)^0))>0, 1, 0))

Where A1:Z17 contains the above data and AE1 has the number you wish to check. This returns, for example, 17 columns for number 11 and 12, 16 columns for number 13 and only 1 column for number 1, as you would hope. You can compare this to a COUNT() of the top row A1:Z1 to see if every column has that number in it.

Hope that helps in your quest

Mackers
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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