+ Reply to Thread
Results 1 to 8 of 8

How to create a dynamic drop down list from multiple values?

  1. #1
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    69

    How to create a dynamic drop down list from multiple values?

    I have some data in a tabular format in one sheet (Sheet1) with some table heads. In the Sheet2 in cell A2 I've created a drop down list.
    What I want to do is when I select an item from that drop down list then in cell B2 of Sheet2 there will be a dynamic drop down list of all the matches (doing lookup or something in Sheet1's data).

    Desired result in Sheet2 should look like below :

    sample1.jpg

    Please help..
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Re: How to create a dynamic drop down list from multiple values?

    You would make Named List List "Ponink" would be table with 001256,00126 etc... Then you need a named list that has all Company names.
    Issue - no spaces in List names so you would need to truncate the company names

    In the conditional for A2 - List - =Companies
    In the conditional for B2 - List - =Indirect(A2)
    If this solves your issue, Mark thread as Solved & Add Reputation.

    Thanks!

  3. #3
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    69

    Re: How to create a dynamic drop down list from multiple values?

    Hi CRIMEDOG,

    I think you didn't understand what I am looking for. The data in Sheet1 will change, so I want a dynamic drop down list on cell B2 of Sheet2 which takes the value in cell A2 of Sheet2 and then finds the corresponding Invoice No's in Sheet1 (if any) and create a drop down list of all the found items i.e. say I choose Royters Alif from the drop down list on cell A2 of Sheet2 then the items of the drop down list in cell B2 of Sheet2 would be 2000125, 2000126 & 2000139, and if I in future change the values (like add, delete or modify rows etc) in Sheet1, the drop down list on cell B2 of Sheet2 will automatically adapt to that and update the drop down list values.

    Basically the value in cell A2 of Sheet2 is the lookup value, the data in Sheet1 table is the table array and Invoice No is the actual lookup result that I want but in normal lookup you get only one result but here there could be multiple results and the drop down list will consist of those results dynamically.

    I hope this made you understand the problem better.
    Last edited by 0Cool; 01-29-2021 at 09:38 AM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: How to create a dynamic drop down list from multiple values?

    I am assuming Excel 2010+ version.

    Sheet3, B2, copied down:
    =IFERROR(INDEX(Sheet1!B:B,AGGREGATE(15,6,ROW(Sheet1!$B$1:$B$100)/(Sheet1!$A$1:$A$100=Sheet2!$A$2),ROWS(B$2:B2))),"")

    to return the invoices. Then a Named range (called Invoices, CTRL-F3 to view/edit), to select the non-blank rows.

    =Sheet3!$B$2:INDEX(Sheet3!$B$2:$B$100,SUMPRODUCT(--(LEN(Sheet3!$B$2:$B$100)>0)))

    Then set the DV to List =Invoices.

    is this what you wanted?
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    69

    Re: How to create a dynamic drop down list from multiple values?

    Hi Glenn,

    Thanks for your solution. Can you explain your code a little ?

    I will do this work on Excel 2010 , right now I'm checking it out on Excel 2019 and it seems to work.

    Thanks

    0Cool

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: How to create a dynamic drop down list from multiple values?

    =IFERROR(INDEX(Sheet1!B:B,AGGREGATE(15,6,ROW(Sheet1!$B$1:$B$100)/(Sheet1!$A$1:$A$100=Sheet2!$A$2),ROWS(B$2:B2))),"")


    Red: where this is true
    cyan: return the row number,
    Green: in ascending order
    Blue: starting from 1 (it's a counter...)
    Purple: finally returning the values from column B.

    That formula would return (potentially) a list with the desired values and a long string of blank rows. The Named Range selects ONLY the non blanks:

    =Sheet3!$B$2:INDEX(Sheet3!$B$2:$B$100,SUMPRODUCT(--(LEN(Sheet3!$B$2:$B$100)>0)))

    Red: Starting from here
    Green: Look down column B
    Cyan: Until you find cells which no longer have a value with a length >0 (i.e. non-blank)

    that then passes the non-blank cells into the DV box.

    If it works for Excel 2010 it will work for later versions. It will not work (without modification) for earlier versions (your profile states Excel 2007, amongst others).



    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

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

  7. #7
    Registered User
    Join Date
    01-11-2019
    Location
    India
    MS-Off Ver
    2010
    Posts
    69

    Re: How to create a dynamic drop down list from multiple values?

    Hi Glenn,

    Can you explain why you chose 15 &6 in the first AGGREGATE function?
    -------------
    0Cool
    Last edited by 0Cool; 01-30-2021 at 03:15 AM.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: How to create a dynamic drop down list from multiple values?

    In AGGREGATE, 15 is the subfunction number for SMALL.. so it returns rows (defined in cyan) matching the criteria (the bit in red AFTER the /) in an array in ascending order... so lowest row number first. the counter (in blue) returns them in ascending order.

    The 6 subfunction tells AGGREGATE to ignore errors.

+ 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] Trying to create a dynamic table so I can create a updating drop down list.
    By sbobster15 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2019, 11:43 AM
  2. How to create dynamic drop down list
    By Sanjibghosh in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-11-2019, 03:05 AM
  3. Create dynamic drop down list from dynamic data source
    By rz6657 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2016, 05:22 PM
  4. Create a Dynamic Drop Down List
    By sinspawn56 in forum Excel General
    Replies: 1
    Last Post: 01-05-2015, 09:07 PM
  5. create dynamic drop down list for large list of data
    By Dariusd7 in forum Excel General
    Replies: 2
    Last Post: 05-10-2014, 04:39 AM
  6. Create a dependent drop down list with dynamic list
    By JSmith1504 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-01-2014, 09:15 AM
  7. Way to create a dynamic drop down list.
    By jensca in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2013, 10:55 AM

Tags for this Thread

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