+ Reply to Thread
Results 1 to 4 of 4

dependant data validation

  1. #1
    Registered User
    Join Date
    03-22-2011
    Location
    Pittsburgh
    MS-Off Ver
    Excel 2007
    Posts
    2

    dependant data validation

    I have a data validation in cell B4. I need cell B21 to auto populate with a drop down list based on the value selected in the B4 drop down.

    For Example: If BREAKFAST FOOD is selected in cell B4, I need to the list in cells F37:F40 to appear in cell B21 as a drop down list.

    I know how to do this with a nested if statement for up to 7 lists but I need to do it for 17 lists.

    Got any ideas? Your help is greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: dependant data validation

    If you make the entries in the P_G_Category named range have the exact same name as the other named ranges, this gets easy. For instance, correct the FABRIC_CARE. named range to remove the period at the end so it matches the option exactly from the B4 drop down exactly.

    Then, in B21, use these Data Validation settings:

    Allow: List
    Source: =INDIRECT(B4)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-22-2011
    Location
    Pittsburgh
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: dependant data validation

    That would work except I have to do this for all these attributes:

    FLAVOR/SCENT:
    DIETARY:
    BAR SIZE:
    PACKTYPE:
    MULTIPACK:
    UNIT SIZE:
    SEASONALITY:
    LIFE STAGE:
    TYPE:

    They all have the same categories so the list names would duplicate

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: dependant data validation

    INDIRECT() allows you to piece together strings to create a final string that is then usable as a "range" reference.

    If you had a main selection cell (B4) where an option FABRIC_CARE could be chosen, then you wanted all the other categories you listed above to have special lists each based on that choice, then you can create named ranges for those like:

    FLAVOR_FABRIC_CARE
    DIET_FABRIC_CARE
    BAR_FABRIC CARE
    etc...

    Then for the Flavor cell in B19, the DV formula would be this to create the correct named range based on the B4 choice:

    =INDIRECT("FLAVOR_" & B4)

    In B20, it would be:

    =INDIRECT("DIET_" & B4)

    ...etc.

    This should allow a virtually limitless connection to named ranges as long as they are named consistently.

    BTW, remember that you can give the same cells multiple name ranges if you want to reuse one range in multiple categories.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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