Find matching values in different columns

paizlea

New Member
Joined
May 3, 2011
Messages
1
I have 3 columns of data (15-digit numbers). I would like to know if anything appears in more than 1 column. I have no idea how to even begin this.

I imagine this may be easier if this was a multi-step process, where I first compare col 1 to col 2, then col 1 to col 3, etc. Sadly, I still can't imagine how to begin.

Thanks in advance for your assistance.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Welcome to the Board

You could have another 3 columns to the side eg, E,F anf G, which would check each number, with either COUNT of FREQUENCY

in E1 = FREQUENCY($A:$C,A1)

Copy down and right as req'd
 
Upvote 0
Try this:-
Results :- Columns addresses for Duplicates/Triplicates in Column "D", Values in "F".

Code:
[COLOR="Navy"]Sub[/COLOR] MG03May38
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] Q [COLOR="Navy"]As[/COLOR] Variant
[COLOR="Navy"]Dim[/COLOR] c [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Set[/COLOR] Rng = Intersect(Range("A1").CurrentRegion, Columns("A:C"))
ReDim Ray(1 To Rng.Count, 1 To 2)
[COLOR="Navy"]With[/COLOR] CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
    [COLOR="Navy"]If[/COLOR] Dn <> "" [COLOR="Navy"]Then[/COLOR]
        [COLOR="Navy"]If[/COLOR] Not .Exists(Dn.Value) [COLOR="Navy"]Then[/COLOR]
             .Add Dn.Value, Array(Dn, 0, "")
        [COLOR="Navy"]Else[/COLOR]
            Q = .Item(Dn.Value)
            [COLOR="Navy"]If[/COLOR] Q(0).Column <> Dn.Column [COLOR="Navy"]Then[/COLOR]
                [COLOR="Navy"]If[/COLOR] Q(1) = 0 [COLOR="Navy"]Then[/COLOR]
                    c = c + 1
                    Q(2) = Q(2) & Q(0).Column & "/ " & Dn.Column
                    Q(1) = c
                [COLOR="Navy"]Else[/COLOR]
                    Q(2) = Q(2) & "/ " & Dn.Column
                [COLOR="Navy"]End[/COLOR] If
                 Ray(Q(1), 1) = "Columns " & Q(2): Ray(Q(1), 2) = Dn.Value
                .Item(Dn.Value) = Q
            [COLOR="Navy"]End[/COLOR] If
        [COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR]
Range("D1").Resize(c, 2) = Ray
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,308
Members
452,904
Latest member
CodeMasterX

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