+ Reply to Thread
Results 1 to 14 of 14

How can I use INDEX&MATCH to populate dropdown list with multiple values?

  1. #1
    Registered User
    Join Date
    11-04-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    68

    How can I use INDEX&MATCH to populate dropdown list with multiple values?

    Hello all,

    this thread is a follow-up on a previous thread in which I used INDEX&MATCH to find a corresponding value to a search string.

    I would now like to use this principle to fill a dropdown list.

    I attached a table.

    In it you will find a search string "A". Then a table with multiple rows where "A" is repeatedly found but with different values in C. I would now like to create a dropdown list where for each A found the corresponding number is listed and can be selected.

    Could someone help me with this please?

    Thank you all very much

    Alex

    EDIT: I cannot attach any files. Is this a forum limitation because I am new? Tried Chrome and IE.

    Here is a picture instead. Sorry about that

    Capture.PNG
    Last edited by AleXSR700; 11-25-2020 at 09:07 AM.

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    match(a4,b6:b12,0) if the numbers are just 1 to 7

    or

    index(c6:c12,match(a4,b6:b12,0) )

    you may need to change , for ; for your locale


    or just use a pivot table with A as the filter and then numbers column as the rows

  3. #3
    Registered User
    Join Date
    11-04-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    68

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    @davsth:
    Not sure I understand. You posted what I posted. (see the formula at the top of the image).

    I am trying to adjust this to return all values separated by ";" so I can use the formula in a dropdown list.

    My, and, if I am not missing something, your formula will only return the first result it finds. Not all of them.


    I did some more digging and I think that maybe the SMALL() function is needed, but I admittedly do not know how to get it to work. Especially not when trying to return all the values separated with ";" so the dropdown can use it.
    Last edited by AleXSR700; 11-24-2020 at 08:47 AM.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    If you choose A in cell A3, how will Excel know which "A" you want to look at in your list in B3:B12? Are you looking for a dropdown list in A4 containing 1,4,5?
    You should be able to attach a file. You'll need to do that in "Go Advanced" Review the yellow banner at the top of the page for instructions.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    To create your list to use for dropdown, in G1 (for example) copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-04-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    68

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    Quote Originally Posted by ChemistB View Post
    Are you looking for a dropdown list in A4 containing 1,4,5?
    That is exactly what I want.

    I attached a file. Sorry, I tried the button next to the emoticon button instead of the "Manage attachments" below the text field.

    So in the attached example I would like to have a dropdown list in F4 which shows the values of 1,4,5. But not by me adding them manually but rather using a formula which will update whenever a new combination of "A" and value in row C occours.

    So should I add B3="A" and C3="100", then the dropdown would contain 1,4,5,100.

    My INDEX&MATCH formula is able to find the first occurence of "A" but does not create a ";" separated list of all of them. And I think that would be needed to use the formula for the dropdown.

    EDIT:
    Quote Originally Posted by ChemistB View Post
    To create your list to use for dropdown, in G1 (for example) copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Two questions:
    1. Is it possible to not limit the search areas but use entire columns? Because the search area will grow over time when people add more data in columns B and C.
    2. This does not create one list but creates individual cell values. Is it possible to not need a copy & paste list but rather a one-liner that creates a ";" separated list which can be used in data validation as the list formula? I do not want to create a list somewhere and then refer the data validation dropdown to an external list.
    Do you know what I mean?

    =INDEX&MATCH/AGGREGATE-Formula should return "1;4;5" in "data validation" - "settings" - "Formula" or "list"
    Attached Files Attached Files
    Last edited by AleXSR700; 11-24-2020 at 10:18 AM.

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    I do not believe that you can use the aggregate (or the Small function or any other way) to bypass the step where you pull your list into a contiguous range. You can place that list on another sheet or hide that column but it must exist for data validation.

    Using an entire column will slow down your workbook calculations. There are over 1 million rows in a sheet. Perhaps an intermediate number that you know they will never go over (i.e. 50, 500, 5000, even 100000)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    In your sheet, i put the formula in Column I (which can be hid) from I1 to I20
    I named this range dynamically in Name Manager so that only actual numbers show.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If your values aren't numbers, then maybe
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then Data Validation > List
    =MyDropDown
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-04-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    68

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    Hello ChemistB,

    thank you for your help!
    Of course I would have preferred to really have everything in one formula and not need any lists, but I made it work based on your recommendations :-)

    Everything works and looks good. I will have to protect all the cells but that's okay too.

  10. #10
    Registered User
    Join Date
    11-04-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    68

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    Hello again,

    I made a few changes because I do not want to work with CSE.

    But I would like to make sure that the dropdown shows a string like "Please select" if the search string is not found.

    I am using
    Please Login or Register  to view this content.
    to create my list.

    I thought that I could just use
    Please Login or Register  to view this content.
    but that syntax is not accepted.

    Any idea why and how I can fix this?

    Alternatively, is there a way to manually add an entry to this formula without adding it to the list I created in H3:H86?

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    My formula didn't use CSE so not sure why you had to adjust to avoid CSE.
    I would move your created list down 1 row and in the first row, enter "Please Select". Then your formula for your dropdown will be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Does that make sense? If not, can you upload an updated example?

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,635

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    Ref Post #8
    Single formula can be used for Named Range

    =$I$1:INDEX($I$1:$I$20,SUM(COUNT($I$1:$I$20),COUNTIF($I$1:$I$20,"*?")))
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  13. #13
    Registered User
    Join Date
    11-04-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    68

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    Hello all,

    I got everything working for my original use case, but now I would like to add another case.

    Current code
    Please Login or Register  to view this content.
    The search string in D2 is being supplied by a second cell on another sheet. I would like to be able to supply a value for D2 which makes the above code list basically all search results for any search term. Basically a "match anything".

    I tried setting the string inside D2 to ?* and to "?*" but neither worked (so tried with and without quotes).

    Does one of you maybe know which value would be the correct one?

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,706

    Re: How can I use INDEX&MATCH to populate dropdown list with multiple values?

    Using the file attached to post #6 a possible modification to the formula could be:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that commas should convert to semi-colons in the attached file.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Index Match List Lookup - Multiple same values with condition
    By UHD in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-25-2019, 09:43 AM
  2. Using Index(Match) to populate list
    By erice in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-11-2018, 05:58 PM
  3. [SOLVED] Populate in-cell dropdown list with values based on sheet name
    By mks16 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-21-2015, 09:35 AM
  4. Vlookup or Index Match to populate multiple values
    By HB07 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-30-2015, 05:18 AM
  5. [SOLVED] Dependent Dropdown List Using Index and Small Won't Return Multiple Values
    By ebevis in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-23-2013, 02:28 AM
  6. [SOLVED] INDEX and MATCH across multiple columns based on dropdown list
    By omni72 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-08-2012, 03:00 AM
  7. Dropdown list and multiple sheet index/match
    By adepascale in forum Excel General
    Replies: 2
    Last Post: 06-01-2011, 04:30 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