+ Reply to Thread
Results 1 to 16 of 16

Data Validation and Dynamic Named Ranges

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Data Validation and Dynamic Named Ranges

    Hi Everyone,

    This has been killing me all day. I can't seem to figure out how to make this work...

    I have numerous lists on Sheet1 of a workbook. They are all named appropriately (ex. F5:F25 = JanuaryContacts, H5:H25 = FebruaryContacts, etc)

    On sheet2, column B I have list of each month in a drop down.

    I'm trying to set it up so when the user chooses January in Sheet2!B2, the JanuaryContacts list will populate in C2. If they choose February in Sheet2!B2, the FebruaryContacts list will populate.

    I am unable to use simple IF statements because there are 12 months.

    I've tried a INDIRECT(SUBSTITUTE)) in the data validation but it doesnt work because the lists are on a separate sheet than the drop downs.

    I've also tried a INDIRECT(VLOOKUP) using a names chart (see directly below) and that didnt work either.

    Column A Column B
    January JanuaryContacts
    February FebruaryContacts



    Could someone please help me figure this out?

    Thanks!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex Data Validation

    Did you try?

    =INDIRECT(B2&"Contacts")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Complex Data Validation

    Sorry - the original posting was just using examples. I should've said that some of the choices are multiple words.

    So instead of "January" in the first drop down, lets say the choice is "January One"

    I'd probably have to use a SUBSTITUTE in there, right? I tried doing that and I couldn't get it to work either.

    Also, I have a separate list in the workbook titled "Contacts" - Will that affect this formula?

    Thanks again!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex Data Validation

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  5. #5
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Complex Data Validation

    I apologize NBVC. I am unable to attach files from here (work).

    Would someone be able to answer how to do a INDIRECT(SUBSTITUTE) if my original drop down is "January One" and I would like my second drop down to come out as "JanuaryOneContacts" ? Hopefully that will work and I'll be able to get the rest from there.

    Thanks!

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex Data Validation

    to do that:

    =Indirect(Substitute(B2," ","")&"Contacts")

    This converts January One to JanuaryOneContacts

  7. #7
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Complex Data Validation

    Ah, yeah, that formula pulls up every contact in the "contacts" list instead of just the ones that go with B2.

    Well I know its difficult to help when I am unable to provide a sample workbook.

    Thanks for trying!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex Data Validation

    If you have a named range called JanuaryOneContacts, and in B2 you have someone select January One, then a dependent drop down list referring to B2 with formula =Indirect(Substitute(B2," ","")&"Contacts") should populate with only those items in JanuaryOneContacts.

    See here for Depend Lists construction and in the middle of the page it shows how to use the Substitue() function to remove blanks.

  9. #9
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Complex Data Validation

    NBVC, would it matter that the JanuaryOneContacts list is defined as:

    =OFFSET('Background Info'!$F$5,0,0,COUNTIF('Background Info'!$F$5:$F$25,">"""),1)

    The way that formula is built shouldn't really matter - I just wanted to include that to show its not a simple defined list.

    Also, when I type in "January One" in B2 and then use tha that formula I get the error "The source currently evaluates to an error. Would you like to continue?" The drop down is then blank.
    Last edited by freybe06; 07-19-2011 at 05:04 PM.

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex Data Validation

    As long as the named range actually selects a range, then I think it should work... Note that the formula goes in a data validation list within another cell (not in B2).

    Again seeing a sample would be best.

    I am off now... so to be continued after you post a sample......

  11. #11
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Complex Data Validation

    Hello again,

    I have attached a sample document. In column B of Sheet1 I would like each cell to populate drop downs based on what is chosen in column A. (Ex. If "January One" is chosen, then the "JanuaryOneContacts" list should appear in a drop down in column B.

    Note: The separate lists in "Background Info" are populated through a simple autofilter/paste macro. I dont think this should affect my problem though.

    Thanks!
    Attached Files Attached Files

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex Data Validation

    Ok for this situation you cannot use Dynamic Lists with Named Ranges containing formulas... so we will have to use the method described here:

    Using Dynamic Lists


    See attached and review the named ranges used and the data validation in B2 of Sheet1.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Complex Data Validation

    I keep getting a "The Source currently evaluates to an error. Do you wish to continue?" error. I click Yes and then try the drop down and nothing appears.

    Also, I have attached an updated version of the file. I'm very sorry - I forgot to add another little hitch in the problem. I have another tab for classes. It is pretty much the same exact situation as the Contacts. When the user chooses "January One" in column A of sheet1, only the January One Classes should populate in the column D drop down.

    Will I have to change the naming convention since "JanuaryOne" is already the name of the JanuaryOne contacts list?

    Thanks again!
    Attached Files Attached Files

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation

    I am not really a fan of:

    I forgot to add another little hitch in the problem
    It causes confusion as those things can turn the whole effort upside down!

    See attached... yes, columns and variables had to be renamed.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Data Validation and Dynamic Named Ranges

    I've named the columns to match the sample, I've copied the data validation exactly, etc. But for some reason I'm only getting 3 blank options on the column B drop down. Is there a setting or something I might be missing?

    Thanks!

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Data Validation and Dynamic Named Ranges

    Is there anything else in the contact or class columns in Background Info?

    If not, can you show a sample with this problem?

+ 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