Best way to combine semi-duplicate rows into one column?

sabot7726

Board Regular
Joined
Jun 2, 2006
Messages
62
Greetings everyone!

I'm looking for a way to combine several duplicate rows of data into one by combining columns. Here's a sample, as you can see column A and B don't change but columns C and D could be different combinations. I'm looking to see if I can combine the repeating rows into one by adding the different data to the C column and removing the D column by adding it into C somehow.

For example Jim Smith would go from 4 rows to 1 that looked similar to: TR10000144 | Jim Smith | ICS 700 (Pre-deployment) (Pending Completion Approval)/ICS-700 (Completed)/ICS-100 (Pre deployment)(Completed)/ICS-100(Completed)|


Excel 2012
ABCD
1TR Identification NumberUser Full NameTraining TitleTranscript Status
2TR10000144Jim SmithICS 700 (Pre-deployment Basic Course)Pending Completion Approval
3TR10000144Jim SmithICS-700Completed
4TR10000144Jim SmithICS 100 (Pre-deployment Basic Course)Completed
5TR10000144Jim SmithICS-100Completed
6TR0008365David CopperfieldICS 700 (Pre-deployment Basic Course)Completed
7TR0008365David CopperfieldICS 100Completed
8TR0008365David CopperfieldICS 100 (Pre-deployment Basic Course)Completed
9TR0008365David CopperfieldICS 700Completed
10TR0008365David CopperfieldIS-700aCompleted
11TR0008365David CopperfieldIS-100bCompleted
12TR0013751Wonder, WomanFEMA ICS-100Completed
13TR0013751Wonder, WomanICS-700Completed
14TR10001115Super, ManICS 700 (Pre-deployment Basic Course)Pending Approval
15TR10001115Super, ManIS-100Completed
16TR10001115Super, ManIS-700Completed
Sheet1


I really appreciate it, I've tried a few things but it throws me that sometimes there's 2 duplicates and sometimes there's up to 7, not sure how to work around that. Thanks!

-Mike
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Try this, Results Start "F1"
Code:
[COLOR="Navy"]Sub[/COLOR] MG10Dec12
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range, n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] Dic [COLOR="Navy"]As[/COLOR] Object
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
ReDim Ray(1 To Rng.Count, 1 To 3)
[COLOR="Navy"]Set[/COLOR] Dic = CreateObject("scripting.dictionary")
Dic.CompareMode = vbTextCompare
    [COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
        [COLOR="Navy"]If[/COLOR] Not Dic.Exists(Dn.Value) [COLOR="Navy"]Then[/COLOR]
            n = n + 1
            Ray(n, 1) = Dn.Value: Ray(n, 2) = Dn.Offset(, 1).Value
            Ray(n, 3) = Dn.Offset(, 2).Value & "," & Dn.Offset(, 3).Value
            Dic.Add Dn.Value, n
        [COLOR="Navy"]Else[/COLOR]
            Ray(Dic(Dn.Value), 3) = Ray(Dic(Dn.Value), 3) & "," & Dn.Offset(, 2).Value & "," & Dn.Offset(, 3).Value
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR]
[COLOR="Navy"]With[/COLOR] Range("F1").Resize(Dic.Count, 3)
.Value = Ray
.Columns.AutoFit
.Borders.Weight = 2
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,097
Members
449,096
Latest member
provoking

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