Unique Value from combination of 2 columns

vpranitha

New Member
Joined
Jun 26, 2014
Messages
25
Hello all,

I have 2 columns like below

Obligor_IDFacility_ID
111111wsd
23455ed
111111eff
56765ed
111111wsd
8888888td

<tbody>
</tbody>

<tbody>
</tbody>

Looking to create a new table only capturing unique values, where the Obligor ID and Facility ID are unique. In the above example should only have 5 rows. The formula is going to be used for 10,000 rows of data.

Appreciate the groups assistance with this.

Thank you
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try Advanced Filter, Copy to another location
check Unique records only

M.
 
Upvote 0
May be
Code:
Sub Test()    Range("A1:B" & Range("A" & Rows.Count).End(xlUp).Row).RemoveDuplicates Columns:=VBA.Array(1, 2), Header:=xlYes
End Sub
 
Upvote 0
Another approach
Code:
Sub UniqueFromTwoColumns()
    Dim i           As Long
    Dim arr         As Variant
    Dim e          As Variant


    arr = ActiveSheet.Range("A1").CurrentRegion


    With CreateObject("Scripting.Dictionary")
        .CompareMode = 1
        For i = 2 To UBound(arr)
            .Item(arr(i, 1) & "," & arr(i, 2)) = .Item(arr(i, 1) & "," & arr(i, 2))
        Next i


        i = 2
        Range("E1:F1").Value = Array("Obligor_ID", "Facility_ID")
        For Each e In .keys
            Cells(i, "E").Resize(, 2) = Split(e, ",")
            i = i + 1
        Next
    End With
End Sub
 
Last edited:
Upvote 0
Please do the followings;

1. Join or concatenate values of both columns in a third column with a delimiter, like ","

2. Remove the duplicate values from this third column

3. Applying "Text to Column" feature, reverse the concatenation of unique values and place them in separate columns again.


You will achieve this without any formula.
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,727
Members
449,049
Latest member
MiguekHeka

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