+ Reply to Thread
Results 1 to 6 of 6

Compiling and aligning info from four data sets with common ID in all of them

Hybrid View

glaza777 Compiling and aligning info... 11-14-2013, 12:25 PM
Chris 53 Re: Compiling and aligning... 11-14-2013, 12:32 PM
glaza777 Re: Compiling and aligning... 11-14-2013, 12:37 PM
MickG Re: Compiling and aligning... 11-14-2013, 02:31 PM
MickG Re: Compiling and aligning... 11-14-2013, 02:32 PM
glaza777 Re: Compiling and aligning... 11-14-2013, 10:18 PM
  1. #1
    Registered User
    Join Date
    11-09-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    3

    Post Compiling and aligning info from four data sets with common ID in all of them

    Hi, I am new to this forum and to advanced Excel usage.

    I need help figuring out how to combine and align information from four different data sets in four separate sheets of Excel, that have common IDs in them, and present it in new sheet in this form:

    ExcelHelpNeeded.PNG

    I am including a spreadsheet with an additional information, and would appreciate any help from gurus on this forum.

    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-30-2013
    Location
    Wales
    MS-Off Ver
    Excel 2013
    Posts
    231

    Re: Compiling and aligning info from four data sets with common ID in all of them

    Hi

    Simple vlookup

    In Master B1 =VLOOKUP(A1,Dataset1!A1:E4,2,FALSE) For other columns change the 2 to 3, 4 or 5.
    For the other datasets Change Dataset1! to Dataset2! etc.

    Does this help?

    Chris

  3. #3
    Registered User
    Join Date
    11-09-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Compiling and aligning info from four data sets with common ID in all of them

    Thank you for such quick reply, Chris! I'll try it tonight and report results.

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Compiling and aligning info from four data sets with common ID in all of them

    Alternative
    See Code:-

    Sub MG14Nov23
    Dim Rng         As Range
    Dim Dn          As Range
    Dim Dic         As Object
    Dim RwRng       As Range
    Dim Ws          As Worksheet
    Dim nRng        As Range
    Dim Ray()
    Dim Ac          As Range
    Dim c           As Long
    Dim oMax        As Long
    With Sheets("Master (Expected Results)") ' change Name as required
      Set Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
    End With
    
    Set Dic = CreateObject("scripting.dictionary")
        Dic.CompareMode = vbTextCompare
        For Each Dn In Rng
            Dic(Dn.Value) = Dn.Row
        Next
    
    
    For Each Ws In Worksheets
        If Not Ws.Name = "Master (expected results)" Then   ' change Name as required
            With Ws
                Set nRng = .Range(.Range("A1"), .Range("A" & Rows.Count).End(xlUp))
            End With
            c = oMax + 1
            For Each Dn In nRng
                Set RwRng = Ws.Range(Ws.Range("B" & Dn.Row), Ws.Cells(Dn.Row, Columns.Count).End(xlToLeft))
                     
                            For Each Ac In RwRng
                                If Ac.Column + c - 2 >= oMax Then
                                ReDim Preserve Ray(1 To Rng.Count, 1 To Ac.Column + c - 2)
                                End If
                                Ray(Dic(Dn.Value), Ac.Column + c - 2) = Ac
                                oMax = Application.Max(Ac.Column + c - 2, oMax)
                            Next Ac
            Next Dn
    End If
    Next Ws
    
    Sheets("Master (expected results)").Range("B1").Resize(Dic.Count, oMax) = Ray ' change Name as required
    End Sub
    Regards Mick

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Compiling and aligning info from four data sets with common ID in all of them

    Alternative
    See Code:-

    Sub MG14Nov23
    Dim Rng         As Range
    Dim Dn          As Range
    Dim Dic         As Object
    Dim RwRng       As Range
    Dim Ws          As Worksheet
    Dim nRng        As Range
    Dim Ray()
    Dim Ac          As Range
    Dim c           As Long
    Dim oMax        As Long
    With Sheets("Master (Expected Results)") ' change Name as required
      Set Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
    End With
    
    Set Dic = CreateObject("scripting.dictionary")
        Dic.CompareMode = vbTextCompare
        For Each Dn In Rng
            Dic(Dn.Value) = Dn.Row
        Next
    
    
    For Each Ws In Worksheets
        If Not Ws.Name = "Master (expected results)" Then   ' change Name as required
            With Ws
                Set nRng = .Range(.Range("A1"), .Range("A" & Rows.Count).End(xlUp))
            End With
            c = oMax + 1
            For Each Dn In nRng
                Set RwRng = Ws.Range(Ws.Range("B" & Dn.Row), Ws.Cells(Dn.Row, Columns.Count).End(xlToLeft))
                     
                            For Each Ac In RwRng
                                If Ac.Column + c - 2 >= oMax Then
                                ReDim Preserve Ray(1 To Rng.Count, 1 To Ac.Column + c - 2)
                                End If
                                Ray(Dic(Dn.Value), Ac.Column + c - 2) = Ac
                                oMax = Application.Max(Ac.Column + c - 2, oMax)
                            Next Ac
            Next Dn
    End If
    Next Ws
    
    Sheets("Master (expected results)").Range("B1").Resize(Dic.Count, oMax) = Ray ' change Name as required
    End Sub
    Regards Mick

  6. #6
    Registered User
    Join Date
    11-09-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Compiling and aligning info from four data sets with common ID in all of them

    Chris, simple vlookup works, with some manual work setting it up on Master sheet. Thank you!

    I'll try Mick's solution as well - looks like more automated way of doing it.

    Thanks,

    Ed

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Combining two data sets (tables), with one common denominatior
    By lomacm in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-29-2013, 02:59 AM
  2. [SOLVED] Ploting multiple data sets with non-aligning x-data
    By motivef in forum Excel General
    Replies: 3
    Last Post: 07-19-2012, 07:49 PM
  3. Merging 2 Data sets without a common column
    By tomcfry in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-27-2007, 12:03 PM
  4. [SOLVED] Aligning rows of data from multiple data sets in columns
    By e abor in forum Excel General
    Replies: 1
    Last Post: 06-29-2006, 04:25 AM
  5. If I have two reoated data-sets and a common code, how can I get i
    By helixed in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-18-2006, 12:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1