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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
17,100
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
Try Advanced Filter, Copy to another location
check Unique records only

M.
 
Upvote 0

YasserKhalil

Well-known Member
Joined
Jun 24, 2010
Messages
842
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

YasserKhalil

Well-known Member
Joined
Jun 24, 2010
Messages
842
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

seekerarcane

Board Regular
Joined
Dec 18, 2016
Messages
104
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,191,686
Messages
5,988,073
Members
440,125
Latest member
vincentchu2369

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
Top