+ Reply to Thread
Results 1 to 11 of 11

4 Levels of Dependent Drop Down Boxes

Hybrid View

adray13 4 Levels of Dependent Drop... 09-23-2015, 01:17 PM
FDibbins Re: 4 Levels of Dependent... 09-23-2015, 01:31 PM
ChemistB Re: 4 Levels of Dependent... 09-23-2015, 04:43 PM
ChemistB Re: 4 Levels of Dependent... 09-24-2015, 09:01 AM
adray13 Re: 4 Levels of Dependent... 09-24-2015, 11:53 AM
ChemistB Re: 4 Levels of Dependent... 09-24-2015, 12:08 PM
ChemistB Re: 4 Levels of Dependent... 09-24-2015, 12:16 PM
adray13 Re: 4 Levels of Dependent... 09-24-2015, 09:38 AM
ChemistB Re: 4 Levels of Dependent... 09-24-2015, 11:24 AM
ChemistB Re: 4 Levels of Dependent... 09-24-2015, 12:05 PM
adray13 Re: 4 Levels of Dependent... 09-24-2015, 12:17 PM
  1. #1
    Registered User
    Join Date
    10-08-2012
    Location
    Houston, Tx
    MS-Off Ver
    Excel 2013
    Posts
    43

    4 Levels of Dependent Drop Down Boxes

    Hi,

    I have a list of Business codes that have four levels (Business, Division, Department, and Group). So, column A is a list of Businesses, column B is a list of Divisions under each Business, column C is a list of Departments under each Division, and column E is a list of Groups under each Division. When someone selects a Business from the drop down I would like the next drop down to contain only the Divisions under the Business they choose and so on. I have attached a spreadsheet with a sample of the data.

    Any help would be much appreciated.

    Thank you!
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: 4 Levels of Dependent Drop Down Boxes

    You will need to create a list of each group and sub-group, and give each 1 a range name. (I will leave that to you). I have attached a sample WB showing 3 levels, and how that works. You would need to add your 4th level.
    Attached Files Attached Files
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Re: 4 Levels of Dependent Drop Down Boxes

    This could be done with a lot of dynamic named ranges and Arrayed formulas so that you don't need to create 4 layers of lists but I will work on it tomorrow.
    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

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

    Re: 4 Levels of Dependent Drop Down Boxes

    Okay, you will need to alphabetize your list for this to work.
    Select A1:D26 > Custom Sort
    by Business, then Add a level, by Division, Add a level, by Department

    In F2 copied down, this ARRAYED Formula

    =IFERROR(INDEX($A$2:$A$26,SMALL(IF(COUNTIF($F$1:F1,$A$2:$A$26)=0, ROW($A$2:$A$26)-1), ROWS($A$1:$A1))),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Then in Name Manager (Formula tab),

    DivA =INDEX(Sheet1!$B$2:$B$26, MATCH(Test!$A$2, Sheet1!$A$2:$A$26,0)): INDEX(Sheet1!$B$2:$B$26, MATCH(Test!$A$2, Sheet1!$A$2:$A$26))=INDEX(Sheet1!$B$2:$B$26, MATCH(Test!$A$2, Sheet1!$A$2:$A$26,0)): INDEX(Sheet1!$B$2:$B$26, MATCH(Test!$A$2, Sheet1!$A$2:$A$26)

    This formula pulls the range of cells relevant to the business chosen in sheet "Test"

    Then in G2 copied down, this Arrayed formula

    =IFERROR(INDEX(DivA,SMALL(IF(COUNTIF($G$1:G1,DivA)=0, ROW(DivA)-INDEX(ROW(DivA),1)+1), 1)),"")

    Then back in Name Manager,

    DepartA =INDEX(Sheet1!$C$2:$C$26, MATCH(Test!$A$4, DivA,0)+INDEX(ROW(DivA),1)-2):INDEX(Sheet1!$C$2:$C$26, MATCH(Test!$A$4, DivA)+INDEX(ROW(DivA),1)-2)

    this pulls the range dependent on what Division was picked in sheet "Test"

    Then H2 copied down, this ARRAYED Formula

    =IFERROR(INDEX(DepartA,SMALL(IF(COUNTIF($H$1:H1,DepartA)=0, ROW(DepartA)-INDEX(ROW(DepartA),1)+1), 1)),"")

    Then in Name Manager

    Group =INDEX(Sheet1!$D$2:$D$26, MATCH(Test!$A$6, DepartA,0)+INDEX(ROW(DepartA),1)-2):INDEX(Sheet1!$D$2:$D$26, MATCH(Test!$A$6, DepartA)+INDEX(ROW(DepartA),1)-2)

    Then in I2 copied down, this (not arrayed) formula

    =IFERROR(INDEX(Group,ROWS($A$1:$A1)),"")

    Lastly, for purposes of using data validation and dropdown menus, in the name manager

    Business = Sheet1!$F$2:INDEX(Sheet1!$F$2:$F$21, SUMPRODUCT(--(LEN(Sheet1!$F$2:$F$21)>0)))
    Division =Sheet1!$G$2:INDEX(Sheet1!$G$2:$G$21, SUMPRODUCT(--(LEN(Sheet1!$G$2:$G$21)>0)))
    Department =Sheet1!$H$2:INDEX(Sheet1!$H$2:$H$21, SUMPRODUCT(--(LEN(Sheet1!$H$2:$H$21)>0)))

    See attachment
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-08-2012
    Location
    Houston, Tx
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: 4 Levels of Dependent Drop Down Boxes

    I have attached my actual data I am using to show you what I have tried to re-create so far. I didn't want to overwhelm anyone seeing almost 3000 rows of data. I am assuming I need to alter the formula in column F to incorporate all 2652 rows which I did. I also changed the DivA and DepartA in the name manager to incorporate 2652 rows. Something weird is happening with the Department drop down though. It repeats the same Department several times. Is there something I am missing that I need to also edit for this to work?

    I found the Name Manager by the way!

    Thank you for any help you can provide.
    Attached Files Attached Files

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

    Re: 4 Levels of Dependent Drop Down Boxes

    Okay, you hadn't updated the rows in GROUP to 2562 in Name Manager

    Edit. Also noted you did not continue the formula down far enough in F to include all busineesses. I suggest F,G,H and I go down to row 30 or so.
    Last edited by ChemistB; 09-24-2015 at 12:11 PM.

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

    Re: 4 Levels of Dependent Drop Down Boxes

    Updated sheet with the expanded ranges
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    10-08-2012
    Location
    Houston, Tx
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: 4 Levels of Dependent Drop Down Boxes

    Thank you all! ChemistB, I am trying to recreate what you have done so that I can learn how you did it. This may be a silly question, but I can't figure out where to put the formula in the Name Manager you reference. Can you point me in the right direction? Much appreciated.

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

    Re: 4 Levels of Dependent Drop Down Boxes

    Okay, so you found Name Manager?

    Then click on "New", then in Name box type DivA
    scope = workbook
    Refers to
    =INDEX(Sheet1!$B$2:$B$26, MATCH(Test!$A$2, Sheet1!$A$2:$A$26,0)): INDEX(Sheet1!$B$2:$B$26, MATCH(Test!$A$2, Sheet1!$A$2:$A$26))=INDEX(Sheet1!$B$2:$B$26, MATCH(Test!$A$2, Sheet1!$A$2:$A$26,0)): INDEX(Sheet1!$B$2:$B$26, MATCH(Test!$A$2, Sheet1!$A$2:$A$26)

    Then "OK"

    Does that answer your question.

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

    Re: 4 Levels of Dependent Drop Down Boxes

    Yep, my fault. I gave you the wrong formula for Column H

    =IFERROR(INDEX(DepartA,SMALL(IF(COUNTIF($H$1:H1,DepartA)=0, ROW(DepartA)-INDEX(ROW(DepartA),1)+1), ROWS($A$1:$A1))),"")

    That should fix everything. Nice job setting it up. Any other questions?

    EDIT: I see we are having a problem with "GROUP" also. Looking into it.

  11. #11
    Registered User
    Join Date
    10-08-2012
    Location
    Houston, Tx
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: 4 Levels of Dependent Drop Down Boxes

    Woohoo! It works!!! Thank you so much.

+ 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. Replies: 8
    Last Post: 02-12-2014, 05:16 PM
  2. Replies: 3
    Last Post: 07-21-2013, 07:20 PM
  3. 3-Tier Dependent Drop Boxes
    By bradweiss in forum Excel General
    Replies: 0
    Last Post: 01-21-2013, 01:41 PM
  4. Need help with Dependent drop down boxes
    By legalsec0331 in forum Excel General
    Replies: 12
    Last Post: 05-26-2012, 03:45 AM
  5. Dependent Drop Down Boxes
    By XL challenged in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2009, 05:32 PM
  6. Multiple dependent drop down boxes
    By Don in forum Excel General
    Replies: 1
    Last Post: 06-22-2006, 02:40 PM
  7. [SOLVED] dependent drop down boxes and dynamic ranges
    By philcud in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  8. [SOLVED] dependent drop down boxes and dynamic ranges
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 08:05 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