+ Reply to Thread
Results 1 to 5 of 5

Data validation based on two named ranges, without vba

Hybrid View

  1. #1
    Registered User
    Join Date
    02-21-2017
    Location
    Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Data validation based on two named ranges, without vba

    Using Excel 2010, I have two named ranges: list_one and list_two, both containing a dynamic number of values.

    Now I want to set a data-validation, type list, on a cell, where all values, of both list_one and list_two are shown in the validation listbox.

    I asumed the following would do the job in source-field of the datavalidation box:
    =list_one;list_two or
    =list_one+list_two or
    =concatenate(list_one,list_two)
    But hey all result in an error

    I also tried to make a new named range, based on both lists, but that also results in errors.

    Can anybody help me out?

    Thanks!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,747

    Re: Data validation based on two named ranges, without vba

    Assume List1 is in column A, and List2 is in column B. Create a third list, List 3 in column C

    A1=List1; B1=List2; C1=List3

    Then, in cell C2:
    Formula: copy to clipboard
    =IF(ROW(C2)<=COUNTA(A:A),INDEX(A:A,ROW(A2)),IF(ROW(C2)<=(COUNTA(A:A)+COUNTA(B:B)-1),INDEX(B:B,ROW(A2)-COUNTA(A:A)+1),""))
    and drag down until you get blank entries.

    DNR for List1:
    Formula: copy to clipboard
    =Sheet1!$A$2:INDEX(Sheet1!$A:$A,COUNTA(Sheet1!$A:$A))

    DNR for List2:
    Formula: copy to clipboard
    =Sheet1!$B$2:INDEX(Sheet1!$B:$B,COUNTA(Sheet1!$B:$B))

    DNR for List3:
    Formula: copy to clipboard
    =Sheet1!$C$2:INDEX(Sheet1!$C:$C,COUNTA(Sheet1!$C:$C))


    Use List3 for your Data Validation List.
    Formula: copy to clipboard
    =List3


    Note: depending on how far you drag down the List 3 formula in column C, you may get some blank entries on the DV List.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,747

    Re: Data validation based on two named ranges, without vba

    You could also use the Named Ranges for List1 and List2 but the formula is a little messier:
    Formula: copy to clipboard
    =IF(ROW(C2)<=COUNTA(List1)+1,INDEX(List1,ROW(A2)-1),IF(ROW(C2)<=(COUNTA(List1)+COUNTA(List2)+1),INDEX(List2,ROW(A2)-COUNTA(List1)-1),""))

  4. #4
    Registered User
    Join Date
    02-21-2017
    Location
    Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Data validation based on two named ranges, without vba

    Thanks a lot!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,747

    Re: Data validation based on two named ranges, without vba

    You're welcome.

+ 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. VLOOKUP in Data validation based on named ranges
    By milo1984 in forum Excel General
    Replies: 4
    Last Post: 12-15-2016, 09:12 AM
  2. Data Validation displaying Information from Named Ranges
    By efolsom54 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2015, 08:11 AM
  3. [SOLVED] Dependent data validation with dynamic named ranges
    By Ace_XL in forum Excel General
    Replies: 4
    Last Post: 08-07-2014, 10:02 AM
  4. Add multiple named ranges in data validation for selection
    By jeffreybrown in forum Excel General
    Replies: 5
    Last Post: 01-21-2012, 11:49 AM
  5. Data Validation and Dynamic Named Ranges
    By freybe06 in forum Excel General
    Replies: 15
    Last Post: 07-20-2011, 01:18 PM
  6. Code for Multiple Named Ranges for Data Validation
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-08-2011, 12:57 PM
  7. Apply data validation using multiple named ranges
    By jburban2 in forum Excel General
    Replies: 3
    Last Post: 10-20-2009, 02:46 PM

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