Forum Discussion

Adam_Kaye's avatar
Adam_Kaye
Copper Contributor
Mar 05, 2024
Solved

How to combine 3 pairs of data

I have a puzzle that feels like it should be solvable with a fairly straightforward solution, but so far I'm stumped.

 

We have 3 datasets for a series of clinical trials: Contacts, Trials, and Sites

 

Those datasets work together in pairs:

  • Contacts coordinate Trials (Contacts can coordinate multiple Trials, and multiple Contacts can coordinate a single Trial)
  • Trials take place at Sites (Trials can take place at multiple Sites, and multiple Trials can take place at a single Site)
  • Contacts are associated with Sites (Contacts can be associated with multiple Sites, and multiple Contacts can be associated with a single Site)

Is there a way to use Excel to identify Contacts, Trials, and Sites in every possible combination?

 

Though I'm not certain this was the right approach, I started down the path to https://www.youtube.com/watch?v=4dGtJUc_jeU, but I eventually hit a roadblock - not knowing what to do once the connections between the tables were established.

 

A teammate has suggested that nested VLOOKUPs might offer a solution, but I have yet to head down that path.

 

If you have any recommendations for how to accomplish this, I'd really appreciate it. Thank you!

  • Lorenzo's avatar
    Lorenzo
    Mar 08, 2024

    Adam_Kaye 

     

    Thanks for your sharing. Don't get me wrong but I also asked + a few examples of what you expect. You know exactly what you expect, on my side I'm note sure. This potentially leads to a waste of time on both sides 😞 Attached is a 1st attempt - see sheet TEMP - based on my understanding that could be wrong...

     

    The duplicates are the complicating factor, but I'm sure there's a way to accommodate them

    Easy to say 🙂 Again you know why they exist and what you expect so you'll have to explain/give examples as I can't guess

     

    Hope this all makes sense

5 Replies

  • Lorenzo's avatar
    Lorenzo
    Silver Contributor

    Adam_Kaye 

     

    Attached is a sample with 3 input Tables and a query (Power Query) that lists all possible combinations. Probably not what you want but with what you shared it's hard to figure out what's ultimately expected 🙂

     

    If you need more help with this, please share (i.e. with OneDrive) a workbook with representative data sets + a few examples of what you expect

    • Adam_Kaye's avatar
      Adam_Kaye
      Copper Contributor

      Lorenzo - Thank you very much for your response.

       

      I'm attaching the file now so you can see how the data is collected in pairs.

       

      I'm just looking to populate the 3rd column ("Trial") on the 1st sheet ("Contact-Site") based on the relationships in the 2nd ("Contact-Trial") and 3rd ("Trial-Site") sheets.

       

      The duplicates are the complicating factor, but I'm sure there's a way to accommodate them.

       

      Thank you again for your help.

      • Lorenzo's avatar
        Lorenzo
        Silver Contributor

        Adam_Kaye 

         

        Thanks for your sharing. Don't get me wrong but I also asked + a few examples of what you expect. You know exactly what you expect, on my side I'm note sure. This potentially leads to a waste of time on both sides 😞 Attached is a 1st attempt - see sheet TEMP - based on my understanding that could be wrong...

         

        The duplicates are the complicating factor, but I'm sure there's a way to accommodate them

        Easy to say 🙂 Again you know why they exist and what you expect so you'll have to explain/give examples as I can't guess

         

        Hope this all makes sense

Resources