+ Reply to Thread
Results 1 to 12 of 12

Generate A List Joining Two Other Lists Based On Cell Input

  1. #1
    Registered User
    Join Date
    08-08-2018
    Location
    Indiana
    MS-Off Ver
    Office 365
    Posts
    20

    Generate A List Joining Two Other Lists Based On Cell Input

    Hello! I hope to explain my question as clearly as possible in this first post, so let's give it a shot.

    I've attached a file which has three tables: A list of characters, a list of languages, and a list where the two IDs are combined in order to represent which characters know which languages. When I received this data, it was in a grid format, with certain characters flagged as knowing certain languages. I included that grid as well, in case it is still of some use.

    What I thought I would be able to do is to create a range where a list of languages known by any combination of characters would generate wherever I wanted it to. The example range is in E24:E34 in this spreadsheet, and the name entries would be in C24:C30. I expected to be able to figure out some kind of array formula that would get a list of languages known by all of them, even if it had duplicates, and then sort the list in another place so that the duplicates were removed. I was not able to do so on my own.

    The three tables exist because this is how I would complete this task as a SQL Query. I did create these tables in Access as a test, and ran a query without a hitch using joins, but I wanted this sheet to be publicly available to all of those involved and be easy enough that a list of characters could be entered, and the languages they know as a group would be generated dynamically.

    Is this scenario plausible in Excel, without writing a new function?
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Generate A List Joining Two Other Lists Based On Cell Input

    Are you using Excel 2016 for this?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-08-2018
    Location
    Indiana
    MS-Off Ver
    Office 365
    Posts
    20

    Re: Generate A List Joining Two Other Lists Based On Cell Input

    I have the Office 365 version. I will update my profile to say that now that it's incorrect.
    Last edited by sp0ck1; 08-10-2019 at 12:55 PM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Generate A List Joining Two Other Lists Based On Cell Input

    OK, so the attached uses PowerQuery to create the languages known list (in green).

    As you understand querying, you should be OK with this, but if not, I can talk you through. Essentially I used your tables to create a list of names and languages, then merged this with the chosen names in order to create the filtered list.

    Update the choose names list and then click on Refresh All on the Data ribbon to see it in action.

    Excel 2016 (Windows) 32 bit
    C
    D
    E
    24
    Choose Names:
    Languages Known:
    25
    Shrubburum
    Dwarvish
    26
    Raul
    Elvish
    27
    Bogrim Steelbelly
    Gnomish
    28
    Judd
    Orc
    29
    Blaise
    Primordial
    30
    Aloket
    Sylvan
    Sheet: Problem
    Attached Files Attached Files
    Last edited by AliGW; 08-10-2019 at 01:09 PM.

  5. #5
    Registered User
    Join Date
    08-08-2018
    Location
    Indiana
    MS-Off Ver
    Office 365
    Posts
    20

    Re: Generate A List Joining Two Other Lists Based On Cell Input

    This is great! I tried PowerQuery briefly before posting this, but it was my first time using it and it wasn't really clicking. I didn't play around with it too much. Would you mind elaborating a little bit if the offer is still there?

    And thank you!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Generate A List Joining Two Other Lists Based On Cell Input

    Yes, of course. However, I'm running short of time now (it's early Saturday evening here), so would you mind if I do it tomorrow morning?

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Generate A List Joining Two Other Lists Based On Cell Input

    So, I am going offline very shortly, but I will post instructions for you when I get up tomorrow.

  8. #8
    Registered User
    Join Date
    08-08-2018
    Location
    Indiana
    MS-Off Ver
    Office 365
    Posts
    20

    Smile Re: Generate A List Joining Two Other Lists Based On Cell Input

    Of course! Thank you

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Generate A List Joining Two Other Lists Based On Cell Input

    Running a bit late on this, but about to look at it now.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Generate A List Joining Two Other Lists Based On Cell Input

    Here we go. Using the original file attached at the start of the thread, follow these steps to recreate the attachment.

    1. First load the three blue tables to connection only, naming them Lang, Char and LangCharID by editing the Name property to the right of the PQ window.
    To do this, with one of the cells in the table selected, go to Data > From Table/Range.
    Next find the Close & Load button at the left end of the ribbon in the PQ editor and select Cloase & Load To ... from its drop-down - select Connection Only.
    Repeat for the other two tables.

    2. On the Data ribbon, Get Data > Combine Queries > Merge.
    Choose LangCharID in the top box and Char in the bottom box.
    Click on the character ID columns in each (they will turn green) and OK.

    3. Using the double-headed arrow at the top of the Char column, select just the Character Names column and deselect the box bottom left of the dialog - click OK.
    Now click on the Merge Queries icon in the ribbon and select the Lang query in the bottom box.
    This time select the language ID columns in the two queries and OK.
    Again using the double-headed arrow, expand the Lang column selecting just the language name and deselecting the little box bottom left - OK.
    Select and remove the two ID columns, name the query LanguagesKnown, then close and load to connection only.

    4. Now we need to create the lookup list.
    Copy and paste the first three names from the character list to cells to C24:C26.
    With these three cells selected, choose Insert > Table - deselect My Table has Headers and click OK.
    Change the column header to read "Choose characters:", then with a cell in the table selected, load the table into PQ in the same way as before.
    Name the query CharFilter and close and load to connection.

    5. Finally, we need to create the results table.
    n the Data ribbon, Get Data > Combine Queries > Merge.
    Select CharFilter at the top and LanguagesKnown at the bottom - the order is important.
    Match the two tables on Choose Characters and Character_Names - OK.
    Expand the table as before, choosing just the Language_Name column and deselecting that little box - OK.
    Delete the character names column.
    Right-click the remaining column and choose Remove Duplicates, then use the downward arrow to sort in ascending order.
    Rename the column "Languages Known:".
    Name the query GroupLangs, then close and load to Existing Worksheet - select E24 as the destination cell.

    That's it. Now all you have to do is change and/or add names to the sepection table and click Refresh All on the Data ribbon.
    Attached Files Attached Files

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Generate A List Joining Two Other Lists Based On Cell Input

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Generate A List Joining Two Other Lists Based On Cell Input

    Thanks for the rep.

+ 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. Generate list based on variable input
    By TPDave in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-24-2016, 12:02 PM
  2. [SOLVED] Generate list based on a changing value in one cell.
    By Ronnet2 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-27-2015, 08:19 PM
  3. Generate list in new sheet/window based on cell value and command button input
    By nathanmrs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-25-2013, 09:37 AM
  4. Replies: 1
    Last Post: 10-24-2013, 08:58 AM
  5. Using Data Validation Lists based on input of another Cell
    By jlundberg in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-02-2013, 11:29 AM
  6. Generate a list from two lists
    By ioncila in forum Excel General
    Replies: 2
    Last Post: 06-24-2012, 02:25 PM
  7. Generate a list from other lists
    By dixiechick11 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2008, 12:52 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