+ Reply to Thread
Results 1 to 27 of 27

Cascading drop down list

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Cascading drop down list

    Hi all. I know that this thread is multiple times posted but i wasn't able to take what i wanted.
    I have an excel sheet that contains horizontally the multiple departments of a company that splits on the various subdivisions and later on on the various role positions. The list is horizontal and what i am trying to achieve is a cascade drop down list so that the user first selects the department, and on the next cell the list to be updated with only the subdivisions available on that department and finally based on that selection to be able to select on the next drop down list the roles specific on that department.
    I tried a lot of online tutorials even with macros but couldn't get what i wanted. Any help appreciated.

  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,908

    Re: Cascading drop down list

    Which online tutorials did you try and in what way did they not work for you? This is all a bit vague.

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Cascading drop down list

    Firstly thank you for the response and the information provided.
    Basically, i tried defining lists on name manager but there are a lot
    of possible combinations to be able to define so many names. Also
    i tried extracting the filtered results of the second column
    based on the first column choice and then input them as data
    on data validation for the second drop list, again without any
    success.
    In the dummy attached i replaced all data with fake for obvious reasons.
    The first selection is the name of the country, which will eliminate
    the results to only the specific to that choice for the next
    selection and goes on.
    If there still are more questions for clarifications please let
    me know.
    Attached Files Attached Files

  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
    44,055

    Re: Cascading drop down list

    1. Is it possible to rearrange the data to have 1 column for America, one for Europe, etc?

    2. is your final choice binary and the same for each country (male/female or Y/N) or have you oversimplified your example?

    3. In total, how many levels are there?
    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
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Cascading drop down list

    Unfortunately this is the given structure, because the next step is to extract some information which are provided on each case chosen and which are written on the same row.
    The choices are not binary and as you correctly guessed i did an oversimplification.
    There are 4 levels and the choices on each level are a lot..
    I actually found this https://www.extendoffice.com/documen...ist-boxes.html link which helped me a little but it is kind of buggy on the results.

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

    Re: Cascading drop down list

    Work sheet event can be used. or helper columns are to be used.
    Which one you prefer.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  7. #7
    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
    44,055

    Re: Cascading drop down list

    I can't/won't do anything with an incorrect sample. First step is to show us EXACTLY how your data are structured, in a REPRESENTATIVE sample sheet.

  8. #8
    Registered User
    Join Date
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Cascading drop down list

    Ok i will try to elaborate even more on the overall task i have to do. Updated excel is attached.
    I have supposedly two group of data. The first group indicates the current position of a person and these data have to be selected from the user using lets say a drop down list. There are four levels of selection but the last level is unique for each case so there is nothing to choose from. This is the reason i didn't include it in the original excel. The choices are NOT binary and there are plenty of choices but given a bad example i chose the gender case.
    Each choice that the user finally makes, results in 3 characteristics. These has to be printed somewhere, for example next to the Own characteristics cell i provided.
    The next task is to try and find the possible destinations located on the second table and the criteria for that is to have a 2/3 match on the data provided for each case on the second table. These possible destinations are to be printed and provided to the user as outcome.
    This is the task i try to do.
    Regarding work sheet events or helper columns i really have no preference as long as this is viable..
    Again thank you for assistance.
    Attached Files Attached Files

  9. #9
    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
    44,055

    Re: Cascading drop down list

    I'm more confused than previously!! What do you expect to see and where do you expect to see it?

    I thought I had a bright idea about how to do this... but it didn't work out.... So, one further question, to see if Plan B is viable. Over how many rows do you want to have this series of drop-down boxes operating?

  10. #10
    Registered User
    Join Date
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Cascading drop down list

    Ok never mind about countries and genders :p I have four level cascading drop down list that each choice has to contain filtered data based on the previous choice. The data are in horizontal structure like i provided. Each final choice after completing the four choices has a corresponding 3 data cells.
    These cells must be compared with the corresponding three data cells on another table and where i have a match (e.g. where at least two out of three data) the choices of the second table will be extracted e.g. as shown next to the Possible Destinations part.
    I expect to see the percentage match next to the second table as shown on the example and next to the possible destinations to see the cases where there is a match greater than 2/3.
    The rows for the drop down list are in total 57.

  11. #11
    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
    44,055

    Re: Cascading drop down list

    There are significant issues with this. Plan B has died... Please confirm that you are still using Excel 2007... Excel 2010+ would have been better!

  12. #12
    Registered User
    Join Date
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Cascading drop down list

    Yes. I am using definitely Office 2013 and above.

  13. #13
    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,908

    Re: Cascading drop down list

    Please update your forum profile to reflect this - it is currently showing Excel 2007.

  14. #14
    Registered User
    Join Date
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Cascading drop down list

    Apologize. Just changed it.

  15. #15
    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,908

    Re: Cascading drop down list

    Thanks for that.

  16. #16
    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
    44,055

    Re: Cascading drop down list

    OK. I've just seen your reply. I've done this using Excel 2007-friendly formulae. I'm still not sure if I understand what you want. But take a look at this and see if it's doing what you wanted regarding 3 level dropdowns.

    I had to sort your data alphabetically by column B, then by C, then by D... otherwise it would have become horribly messy, I think. I won't explain anything yet, as I may be miles out in my guess!!!
    Attached Files Attached Files

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

    Re: Cascading drop down list

    Here is the code for Worksheet event.
    Range for Validation list is B3:D25. Range for selection of lists is G4:I20.
    They can be changed individually in the code if required.


    Please Login or Register  to view this content.
    To paste the code
    Right click on Sheet tab --> view code
    VB window opens.
    Paste the code
    Close the window.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 07-03-2019 at 11:11 AM.

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

    Re: Cascading drop down list

    Like Glen, I had to use helper columns (B31:E36) and the data needs to be custom sorted, first by B, then C, then D, then E.

    I used Name Manager to create names for list placements List, List1A, List2A, and List3A refer to the positions within your original data and List1,List2, List3 and List4 refer to the new lists in B31:E36 for the data validation dropdown cells. The dropdowns are in B29:E29

    Example formulas for List2A
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    For List 3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    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

  19. #19
    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
    44,055

    Re: Cascading drop down list

    Chemist B... Confused. How can that work for 57 rows of dropdowns... or am I missing something?

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

    Re: Cascading drop down list

    I missed the part of having 57 rows of dropdowns. It would get very messy.

  21. #21
    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
    44,055

    Re: Cascading drop down list

    Hehehe! Nice to see someone of your calibre missing something!! I'm forever missing stuff...

  22. #22
    Registered User
    Join Date
    05-19-2019
    Location
    America
    MS-Off Ver
    2019
    Posts
    13

    Re: Cascading drop down list

    I'm kind of confused on what you are looking for.
    But I think I had a similar issue...You need the dependent drop down lists to be dependent on the list values that come before it. For example, the 3rd drop down list needs to be dependent on both the 2nd and 1st list values, and as a result, only the criteria that matches the values of list 1 and 2 will show up for list 3.

    Is that similar to what you need? If so, I have attached something that might work for you.

    *Edit: Also, I am sorry if this is not what you are looking for.
    Attached Files Attached Files
    Last edited by Lucko4Life; 07-04-2019 at 03:15 AM.

  23. #23
    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
    44,055

    Re: Cascading drop down list

    LuckofLife... I didn't do down that route for two reasons:

    1. The data structure is a vertical table and (mainly),

    2. This becomes a nightmare if there are a lot of options at each level (so many named ranges). With YOUR data structure, there is a way to do it with only 1 NR per DD column

  24. #24
    Registered User
    Join Date
    05-19-2019
    Location
    America
    MS-Off Ver
    2019
    Posts
    13

    Re: Cascading drop down list

    Gleen Kennedy,
    You are right. I am not satisfied with that solution either. I have been stuck on that for days and that is the best I could find so far, besides a script on Google Sheets (which is exactly what I want, but I need it for Excel unfortunately).
    I have only been using Excel for about a month, so I have a lot to learn.

    I did find this other workbook that someone posted on another forum years ago. They auto populate information from one data table onto helper columns and use that as the data source. But I do not know how to tailor it to this person's situation, or my own for that matter, or if that's even what they are asking for.

    I'm just throwing stuff out there trying to help since others have helped me.

    Here is that workbook I found, I am not sure if it will be of any help as I mentioned. I apologize if it's useless to you.
    Attached Files Attached Files

  25. #25
    Registered User
    Join Date
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Cascading drop down list

    First of all thank you for the valuable response and the solutions provided. All of the solutions were exactly to the point and i think this thread will be valuable to others as well.
    Glenn you got the point and thank you.
    Even though the solutions work, i prefer working with macros instead of formulas. So i kept the kvsrinivasamurthy solution who i honestly thank.
    I added the Target.Offset(0, 2) = "" on the first part of the code so that the rest of the choice cells to be cleared also when the user makes the choice on the first one.
    The only bug i find is that when i replace the name Set SecRng = Range("C3:C25") with Set SecRng = Worksheets("Sheet2").Range("C3:C25") does not work and the outcome is kind of messed up. When i try this on the same sheet it works fine. Is the Intersect function buggy when the source data are in another worksheet?

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

    Re: Cascading drop down list

    Have you tried worksheet event given in post17.

  27. #27
    Registered User
    Join Date
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Cascading drop down list

    Please Login or Register  to view this content.
    This is your code but modified based on the actual needs. The results are that only the first choice cell has a drop down list and the others don't. Also the drop down list with the same data is created on other "random" cells of the same row.

+ 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. Bottom up hierarchy in dependent cascading drop down list
    By sergeipol in forum Excel General
    Replies: 8
    Last Post: 11-06-2018, 02:19 AM
  2. Replies: 1
    Last Post: 02-04-2017, 04:43 AM
  3. Dynamic dependent drop-down list with cascading queries?
    By amieamieamie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-16-2013, 09:44 AM
  4. hiding a cascading drop down list
    By silverdan7 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-09-2013, 12:06 AM
  5. Cascading drop down question
    By Chrisrokc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2012, 06:24 PM
  6. Cascading Drop Down Menus? Is this possible?
    By AFK_Matrix in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-10-2006, 08:20 AM

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