+ Reply to Thread
Results 1 to 19 of 19

Grouping Multiple Excel Sheets via Speciifc Column ID

  1. #1
    Registered User
    Join Date
    07-11-2019
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    10

    Grouping Multiple Excel Sheets via Speciifc Column ID

    Good Morning, have a problem been attempting to solve with vlookup with no success. I have 3 excel spreadsheets, 2 are the input sheets and the third is for completed display. The unique id will be the custom ID number which is on all documents. now the columns are different between the two input sheets, and my goal is this. Using the ID, look at each sheet and import the data to the correct columns in the display sheet.. IE like this. Sheet 1, ID is column 1. Ranges 2 through 20 go to display sheet for use. They populate 2 through 20. Now sheet 2, using column 1 id, the ranges 2 through 20 columns are different then sheet 1 and I want them to go to end of string so say 21 through 41 cells. That is the ultimate goal. I am having problems achieving this.

    Now the only other item I have to consider, sometimes sheet 1 will have custom id that are not on sheet 2, but I want them to still show up on display sheet. So that is why I am using vlookup.

    Any assistance would be appreciated?

    V/r

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    Hello and welcome to the forum.

    I recommend uploading a small representative sample of your data along with the desired results (which you can enter manually) based on that data.

    To upload an Excel workbook, follow these steps:
    1) Click on "Go Advanced"
    2) Click on "Manage Attachments"
    3) Click on "Choose File"
    4) Choose your file and click on "Open"
    5) Click on "Upload"
    6) Click on "Close this window"

  3. #3
    Registered User
    Join Date
    07-11-2019
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    10

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    Okay added attachments. Hope did this right. Thank you!
    Attached Files Attached Files

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    Oh you have 3 different workbooks, not worksheets.

    You have a couple of different options here. Here's one:

    Combined!B2 =INDEX('[Book 1.xlsx]Sheet1'!B:B,MATCH($A2,'[Book 1.xlsx]Sheet1'!$A:$A,0))&""
    Drag through E2 then down.

    Combined!F2 =INDEX('[Book 2.xlsx]Sheet1'!B:B,MATCH($A2,'[Book 2.xlsx]Sheet1'!$A:$A,0))&""
    Drag through I2 then down.

  5. #5
    Registered User
    Join Date
    07-11-2019
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    10

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    Thank you, this is going to work I do believe for what I need. Testing it out now and will report findings. I do appreciate the quickness and thorough explanation!

  6. #6
    Registered User
    Join Date
    07-11-2019
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    10

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    Okay this is the two problems I have, I do have some that have multiple ID in same cell (so they don't show up properly) and I have to manually enter the ID (would like to have it auto populate so I don't miss anything) when dealing with 100's of lines. Working on what you gave 63falcondude. Thanks so far!

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    Happy to help.

    If you upload a more representative sample of your data, I'll take a look.

    I'm confident that we can come up with a solution that works for you.

  8. #8
    Registered User
    Join Date
    07-11-2019
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    10

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    Will do so in morning (left project at work) and now home but yes i will get you more information and use some screen shots to compliment my request.

    V/r
    Belszy

  9. #9
    Registered User
    Join Date
    07-11-2019
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    10

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    Morning, I have uploaded two screen shots with what I am trying to do. Basically the problem is this, there are two columns of ID that I am trying to match not just one (didn't realize it at first), but the ID can have multiple numbers as you can see on screen shots (they are grouped into one long string) which I guess can work if it matches, but I want to be able to pick out say a 51 out of there and match it to other document and fill in respective columns. The first equation worked very well for single occupant cells, but add in multiple and didn't factor in to well. Let me know what you think? If you have questions please ask!

    V/r
    Belszy
    Attached Images Attached Images

  10. #10
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    This has turned into a completely different request due to the layout of your actual data.

    This is a terrible way to store data. I recommend cleaning your data so that you are then able to use it for analysis.

    This means having one value per cell with the other values repeating down the column.

    For example, using your 2nd screenshot, cell B19 would have 51, C19 would have 4500561605, D19 would have #005, etc.
    and B20 would have 122, C20 would have 4500561605, D20 would have #005, etc.

    That being said, there's not much that I can do with screenshots. Samples like you shared in post #3 (including the expected outcome) are much more helpful.

  11. #11
    Registered User
    Join Date
    07-11-2019
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    10

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    63falcondude , okay I have taken your advice and broken apart the sheet into single line items for the ids. I did this on both sheets, so now here is the way documents are layed out. Sheet 1, Column A is main item number, Column B is secondary. On the combined excel document with the formula, if first or second column are not present on combined sheet, I would like it to add them. Then when I do sheet 2, Column B is main search and Column A is secondary (meaning it needs to look at column B first and search combined Column A for a hit, if that matches, then needs to look at column A and match that with Column B of the combined for a match. If it matches fills in appropriate data, if no match found, then add to bottom of sheet.

    Is this to complex for excel?

    V/r
    Belszy
    Attached Images Attached Images

  12. #12
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    It is difficult to work with screenshots.
    I recommend uploading a small representative sample workbook of your data along with the desired results (which you can enter manually) based on that data.

    To upload an Excel workbook, follow these steps:
    1) Click on "Go Advanced"
    2) Click on "Manage Attachments"
    3) Click on "Choose File"
    4) Choose your file and click on "Open"
    5) Click on "Upload"
    6) Click on "Close this window"

  13. #13
    Registered User
    Join Date
    07-11-2019
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    10

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    Done per request!
    Attached Files Attached Files

  14. #14
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    It's simple enough to combine data from two workbooks, using Power Query.

    However, I'm struggling to understand your ID logic.
    Rows in Book 1 have an ID and optionally an SS ID.
    Rows in Book 2 have an SS L&D # and optionally a TM L&D #.

    I don't understand how you want to join / aggregate this data. Can you please make this clearer, by way of example?
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  15. #15
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    So what you need is to split individual IDs in SS ID when multiple is present in single row and duplicate records.

    To do this I'd recommend using PQ,

    1. Load both workbooks to PQ.
    2. BOOK1 - You'd load RPT_TM_LD table. Make sure SS ID is set to text type column.
    3. Split SS ID - Right click on the column, choose Split Column -> by Delimiter. Using --Custom-- #(lf), which is new line character, at each occurrence of the delimiter and set advanced options to "Rows".
    0.JPG

    4. Merge Sheet1 of Book2 into RPT_TM_LD, using SS ID as key. Sort on SS ID descending.

    5. Load RPT_TM_LD back to new sheet.

    See attached sample.

    Note: To change source workbook, go to the query/connections pane and double click on the query name. Then double click on "Source" step in Applied steps pane and change file Path.
    Note2: Sheet1 of Book2, has additional transformation, as I had to promote 1st row to the header, and filtered out null SS L&D#.

    M code for RPT_TM_LD
    Please Login or Register  to view this content.
    Edit: Hmm, did I misread? I thought it was simple left outer join. But is it Union, then left join?
    Attached Files Attached Files
    Last edited by CK76; 07-16-2019 at 11:32 AM.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  16. #16
    Registered User
    Join Date
    07-11-2019
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    10

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    SSID and SS LD are same numbers.. just one person puts it in column A, and another in Column B. ID and TM LD are same (all broken into single rows).

  17. #17
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    So should rows be joined between workbooks based on matching both ID and SSID? Or just one (which?)

  18. #18
    Registered User
    Join Date
    07-11-2019
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    10

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    yes they should join first by looking at ID, if that matches then checks the SSID, if it matches, data joins, if it doesnt match throw next line down?

  19. #19
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Grouping Multiple Excel Sheets via Speciifc Column ID

    Wait... so which is the left table (i.e. table that should keep all rows).

    And is it that it must match on both columns to join?

    If RPT_TM_ID is the left table and both columns need to match. You just have to adjust the file to use both Id & SS ID as match to SS L&D# & TM L&D#.

    Notice the small numbers (you must first select ID then SS ID on RPT_TM_LD, then on Sheet1, select TM L&D # then SS L&D #).

    0.JPG

    If all data from BOTH tables must be kept, use full outer join with same keys.

+ 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. [SOLVED] Search for speciifc string in specific sheets
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-09-2016, 08:42 AM
  2. Save workbook to speciifc path
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-08-2015, 10:24 AM
  3. Replies: 6
    Last Post: 10-18-2012, 03:10 PM
  4. Replies: 10
    Last Post: 07-22-2012, 07:32 PM
  5. Grouping/Ungrouping Sheets in Excel 2007
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 11-08-2007, 03:24 AM
  6. Grouping sheets with one hand in Excel
    By Steve Vincent in forum Excel General
    Replies: 2
    Last Post: 04-05-2006, 02:30 PM
  7. Grouping excel sheets into workbook
    By kalyan_ysn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-16-2005, 05:46 PM

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