+ Reply to Thread
Results 1 to 12 of 12

Dependent List Validation from Dynamic Named Ranges

  1. #1
    Registered User
    Join Date
    10-29-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    4

    Dependent List Validation from Dynamic Named Ranges

    All,

    I have something that in my mind "should" be working, but it is not in Excel 2007. It may be a version issue, but I don't think it is related. I have attached a sample spreadsheet that relates what I am trying to accomplish, but to summarize I am trying to do the following:
    • Create Several Dyamically named ranges (using the name manager and the offset function)
    • Create a data validation dependent upon first selection
    • Force the dependent validation to pick up the correct dynamically named range using a concantenated cell and an INDIRECT function in the list source

    However, when I try to do so, I get a pop-up stating that there is an error. The twist is that if I hardcode my named ranges rather than making them dynamic, it works fine. Furthermore, when I hardcode a cell's list validation to the dynamic named range, it works fine. It's only when I try to do a dependent selection that things go awry.

    Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Dependent List Validation from Dynamic Named Ranges

    I may be mistaken here, but I'm fairly sure that the use of INDIRECT function when used to reference dynamic named ranges in Data Validation lists will not work and is, unfortunately, an Excel limitation.

    As you have already discovered, either using a static named range or entering the dynamic named ranged directly in the list source does work.

    Perhaps there is a work-around for this and someone will chime in.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    10-29-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Dependent List Validation from Dynamic Named Ranges

    Just re-read. Me no likey "limitation"
    Last edited by freeride; 11-11-2009 at 07:16 PM. Reason: i'm an idiot

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Dependent List Validation from Dynamic Named Ranges

    I just came across this via another thread.

    Quote Originally Posted by Palmetto
    Perhaps there is a work-around for this and someone will chime in.
    A workaround is CHOOSE... let's say you create a list of your dynamic ranges, eg:

    A1:A3: nonWorkingList1,nonWorkingList2,nonWorkingList3

    You can then, for your validation source in E16 use:

    Please Login or Register  to view this content.
    and you should find your validation list populates as expected as G14 alters (as a result of prior selections).

    Needless to say the above is not overly elegant and can become quite ungainly pending volume of lists...

  5. #5
    Registered User
    Join Date
    10-29-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Dependent List Validation from Dynamic Named Ranges

    I thought I'd update this thread with the workaround version of the spreadsheet...
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-06-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Dependent List Validation from Dynamic Named Ranges

    First of all: what a shame this has to be a system limitation. So far I hadn’t found any limitation using excel, well at least there were reasonable one and I always work around it through VB, but not one like this!

    Anyway, I have found an additional workaround without having to write all names on the CHOOSE formula

    PROS:
    Main categories as well as subcategories will be automatically populated
    No need to type in dynamic names on CHOOSE formula
    Should be a type and forget about it kind of formula (unless your list has more than 25000, in which case it could be fixed)
    There is no need to create dynamic list for ALL subcategories

    CONS:
    Still need to keep a nice and clean sheet for all categories and might need extra sheet for third dependent list
    You need to have one cell to write down the sheet name where the lists are. This is because of another data validation limitation, which is “no other sheet reference”

    What I just did is to create a dynamic range for the main categories (on my example called "type") on the entire 1:1 row

    Then I formulated directly on the data validation - list field

    The formula I used on the dependant list is the following:

    =OFFSET(INDIRECT(ADDRESS(1,MATCH(C6,type,0),1,1,E5)),1,0,COUNTA(OFFSET(INDIRECT(ADDRESS(2,MATCH(C6,type,0),1,1,E5)),0,0,25000+N("how much longer are your lists"),1)),1)
    C6 is the cell in which the first dynamic list is
    E5 contain the name of the cell in which the list are
    I wish I could attach the file, but somehow I am unable

    You have to delimit the number of rows for the COUNTA formula. If this could bee seen as a disadvantage, it would be an advantage as well, maybe you want to delimitate number of category members so you can have, let’s say, from row 25000 down to other stuff you want to keep.

    I still hope someone on Bill's team do the job and fix this problem from its root
    If you need something else you can find me here

    http://www.allexperts.com/ep/1059-11...o-Castillo.htm

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Dependent List Validation from Dynamic Named Ranges

    I've not read through the above but I would add a further simple workaround suggested by our very own romperstomper (MS Excel MVP) which would be to use the old XLM Evaluate call via a Name to create the final listing.

    Using original example of:

    =CHOOSE(MATCH($G$14,$A$1:$A$3,0),nonWorkingList1,nonWorkingList2,nonWorkingList3)

    We can instead simply create one further Define Name:

    Name: =_DVList
    RefersTo: =Evaluate(INDIRECT("G14"))

    At which point the source for our dependent Validation List becomes simply:

    =_DVList

    As G14 is altered so the dependent list will update in turn irrespective of whether the Names in use are dynamic.

    This approach is not 100% applicable but for the majority of cases it is a very simple, effective & elegant workaround.

    Kudos to romperstomper for demonstrating this technique previously.

  8. #8
    Registered User
    Join Date
    10-29-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Dependent List Validation from Dynamic Named Ranges

    Very cool workarounds...and that last one IS pretty elegant. I've used my previous dozens of times already, and now with this simple solution, I'm going to save A LOT of keystrokes!!

    Thanks gang...

  9. #9
    Forum Contributor
    Join Date
    12-03-2009
    Location
    Providence RI
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    260

    Re: Dependent List Validation from Dynamic Named Ranges

    Does that Eval one work if the lists are fields on another sheet? It seemed to at first when I first did it. Then I saved the file and now it just says the formula results in an error. I can not get it to work now... so confused.
    Last edited by Dulanic; 04-09-2010 at 12:48 PM.

  10. #10
    Registered User
    Join Date
    04-06-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Dependent List Validation from Dynamic Named Ranges

    good workaround as well!

    here is the file I couldn't attach last time

    http://www.4shared.com/document/EqMu..._Indirect.html

  11. #11
    Registered User
    Join Date
    05-05-2018
    Location
    Bogota
    MS-Off Ver
    Office 2007
    Posts
    1

    Thumbs up Re: Dependent List Validation from Dynamic Named Ranges

    Thank you so much, I was struggling with this for 3 weeks and you just make it clear and easy to apply, saved my life

  12. #12
    Registered User
    Join Date
    01-22-2020
    Location
    England stafford
    MS-Off Ver
    2010
    Posts
    1

    Re: Dependent List Validation from Dynamic Named Ranges

    sorry to ask but is there any chance you still have the sample file for this that you could send me. thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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