Adding Identifier to Spreadsheet in order to Categorize

brandonmcg

New Member
Joined
Jan 14, 2009
Messages
43
Office Version
  1. 2016
Platform
  1. Windows
I am not sure this is going to make sense or not.
I have a list of loans where my report lists the borrowers in a order.
If you notice there are multiple of the same loan number but there are more than one borrower and they have different Tax ID's.
How do I get it to look like the example at the bottom of the page? I need all common borrowers with the same loan number on one line with their matching tax ID.

Sample Report
Loan NumberBORROWERTAX_ID
7901359Bob Smith
123456789​
7901359Mary Smith
124342333​
7901426Tom Jones
125227877​
7901545Angus Young
126113421​
7901839Steven Tyler
126998965​
7901914Mary Kluger
127884509​
7902076Sheldon Cooper
128770053​
7902076Amy Cooper
129655597​
7902293Leonard Hofstader
130541141​
7902293Kelly Hofstader
131426685​
7902293Baby Hofstader
132312229​
7902347Stuary Bloom
133197773​
7902436Raj Koothreppali
134083317​
7902568Leslie Winkle
134968861​
7903704Blake Shelton
135854405​
7903858Sammy Hagar
136739949​
7904087Samantha Fox
137625493​
7904087Howard Wolowitz
138511037​
7904087Bernadette Wolowitz
139396581​
7904130Emily Sweeney
140282125​
7904269Sara Bareilles
141167669​
7904277Alan Parsons
142053213​
7904277Jill Parsons
142938757​
7904873David Lee Roth
143824301​
7904873Wife Lee Roth
144709845​
7905257Alice Cooper
145595389​

How do I get it to look like this?

Loan NumberBORROWER 1TAX_ID 1Borrower 2Tax ID 2Borrower 3Tax ID 3
7901359Bob Smith123456789Mary Smith124342333
7901426Tom Jones125227877
7901545Angus Young126113421
7901839Steven Tyler126998965
7901914Mary Kluger127884509
7902076Sheldon Cooper128770053Amy Cooper129655597
7902293Leonard Hofstader130541141Kelly Hofstader131426685Baby Hofstader132312229
7902347Stuary Bloom133197773
7902436Raj Koothreppali134083317
7902568Leslie Winkle134968861
7903704Blake Shelton135854405
7903858Sammy Hagar136739949
7904087Samantha Fox137625493Howard Wolowitz138511037
7904087Bernadette Wolowitz139396581
7904130Emily Sweeney140282125
7904269Sara Bareilles141167669
7904277Alan Parsons142053213Jill Parsons142938757
7904873David Lee Roth143824301Wife Lee Roth144709845
7905257Alice Cooper145595389
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi Brandonmcg,

Does this do what you want?

Brandonmcg-2.xlsx
ABCDEFGHIJK
1Loan NumberBORROWERTAX_IDLoan NumberBORROWER 1TAX_ID 1Borrower 2Tax ID 2Borrower 3Tax ID 3
27901359Bob Smith1234567897901359Bob Smith123456789Mary Smith124342333  
37901359Mary Smith1243423337901426Tom Jones125227877    
47901426Tom Jones1252278777901545Angus Young126113421    
57901545Angus Young1261134217901839Steven Tyler126998965    
67901839Steven Tyler1269989657901914Mary Kluger127884509    
77901914Mary Kluger1278845097902076Sheldon Cooper128770053Amy Cooper129655597  
87902076Sheldon Cooper1287700537902293Leonard Hofstader130541141Kelly Hofstader131426685Baby Hofstader132312229
97902076Amy Cooper1296555977902347Stuary Bloom133197773    
107902293Leonard Hofstader1305411417902436Raj Koothreppali134083317    
117902293Kelly Hofstader1314266857902568Leslie Winkle134968861    
127902293Baby Hofstader1323122297903704Blake Shelton135854405    
137902347Stuary Bloom1331977737903858Sammy Hagar136739949    
147902436Raj Koothreppali1340833177904087Samantha Fox137625493Howard Wolowitz138511037Bernadette Wolowitz139396581
157902568Leslie Winkle1349688617904130Emily Sweeney140282125    
167903704Blake Shelton1358544057904269Sara Bareilles141167669    
177903858Sammy Hagar1367399497904277Alan Parsons142053213Jill Parsons142938757  
187904087Samantha Fox1376254937904873David Lee Roth143824301Wife Lee Roth144709845  
197904087Howard Wolowitz1385110377905257Alice Cooper145595389    
207904087Bernadette Wolowitz139396581       
217904130Emily Sweeney140282125       
227904269Sara Bareilles141167669       
237904277Alan Parsons142053213       
247904277Jill Parsons142938757       
257904873David Lee Roth143824301       
267904873Wife Lee Roth144709845       
277905257Alice Cooper145595389       
Sheet1
Cell Formulas
RangeFormula
E2E2=MIN($A$2:$A$9999)
F2:K27F2=IF($E2="","",IFERROR(INDEX($B$2:$C$9999,AGGREGATE(15,6,ROW($A$2:$A$9999)-ROW($A$1)/(($A$2:$A$9999=$E2)),INT((COLUMN()-COLUMN($E$1)+1)/2)),ISODD(COLUMN()-COLUMN($F$1))+1),""))
E3:E27E3=IFERROR(AGGREGATE(15,6,$A$2:$A$9999/(($A$2:$A$9999>E2)*($A$2:$A$9999<>"")),1),"")
 
Upvote 0
VBA approach:
VBA Code:
Sub brandon()
    Application.ScreenUpdating = False
    Dim arr As Variant, dic As Object, rng As Range, fVisRow As Long, cnt As Long, x As Long, y As Long: y = 1
    Dim LastRow As Long
    arr = Range("A2", Range("A" & Rows.Count).End(xlUp)).Value
    Set dic = CreateObject("Scripting.Dictionary")
    For i = 1 To UBound(arr, 1)
        If Not dic.Exists(arr(i, 1)) Then
            dic.Add arr(i, 1), Nothing
            With Range("A1")
                .CurrentRegion.AutoFilter 1, arr(i, 1)
                cnt = [subtotal(103,A:A)] - 1
                If cnt > 1 Then
                    fVisRow = Range("A2", Range("A" & Rows.Count).End(xlUp)).SpecialCells(xlCellTypeVisible).Cells(1, 1).Row
                    For Each rng In Range("B" & fVisRow, Range("A" & Rows.Count).End(xlUp)).Offset(1).SpecialCells(xlCellTypeVisible)
                        rng.Resize(, 2).Copy Cells(fVisRow, Columns.Count).End(xlToLeft).Offset(0, 1)
                        Rows(rng.Row).Delete
                    Next rng
                End If
            End With
        End If
    Next i
    lcol = ActiveSheet.UsedRange.Columns.Count
    For x = 2 To lcol Step 2
        Cells(1, x).Resize(, 2) = Array("BORROWER " & y, "TAX ID " & y)
        y = y + 1
    Next x
    Columns.AutoFit
    Range("A1").AutoFilter
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Solution
I am trying the MACRO and it is freezing my Excel. I will continue to try to get it to run.
 
Upvote 0

Similar threads

Forum statistics

Threads
1,223,276
Messages
6,171,138
Members
452,381
Latest member
Nova88

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