+ Reply to Thread
Results 1 to 9 of 9

Indirect Offset Data Validation

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Great Southern Land
    MS-Off Ver
    2010 - Excel, Access, Word, Outlook.
    Posts
    7

    Indirect Offset Data Validation

    Hello

    I have a named range over a fixed range.
    I have set up data validation using the indirect function to receive the name of my named range from another cell.
    This produces the list of values in my named range as desired.
    When I change the named range from a fixed range to use the offset function, the data validation no longer works.
    Is there something about the offset function I am forgetting?


    Thanks.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: Indirect Offset Data Validation

    We can't guess at what you might be doing wrong when the only thing we know is that you are using the OFFSET function. Please show:

    1. The data validation rule you are using
    2. Identify the sheet/cell where you are using data validation
    3. The definition of the named range
    4. What "no longer works" means. What is happening?


    The best option is to attach your file (see yellow banner at the top of the page).
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-04-2012
    Location
    Great Southern Land
    MS-Off Ver
    2010 - Excel, Access, Word, Outlook.
    Posts
    7

    Re: Indirect Offset Data Validation

    Hello

    I have attached an example workbook.
    Sheet1 Cell B2 has the dynamic, dependent, drop down lists using the method I have previously used with the indirect function inside offset function executed from the data validation list option. This works as expected.
    Sheet2 Cell B2, tries to use the data validation list option to call the named range using the indirect function against the result of Sheet2 Cell A2. The named range is dynamic using the offset function.
    I cant figure out why the example in Sheet2 does not work.

    Regards,
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: Indirect Offset Data Validation

    INDIRECT does not work with dynamic named ranges. You are using INDIRECT($A$2) and A2 contains a dynamic range name, which INDIRECT cannot resolve.

    I have rearranged your lookup data to associate the vehicles more closely with each list of vehicle types, and put a formula directly into the data validation. You no longer need to use the names Boat, Tank, Truck, etc. This allows you to add more vehicles (motorcycle, trailer, whatever) without having to add new named ranges or change any formulas.

    The reason the formula on Sheet1 works is that you are using:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Here INDIRECT refers to cell A2, a static range, rather than a named formula.
    Attached Files Attached Files
    Last edited by 6StringJazzer; 10-15-2021 at 08:34 AM.

  5. #5
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,028

    Re: Indirect Offset Data Validation

    Another option:
    If you set the dynamic range as an actual table, you can use it with INDIRECT in data validation.
    Create multiple tables, one for each item on the list, use each item as the table name. Excel will automatically create named range with the table name.
    If there are spaces in the item, in the table name change it to underscore, e.g "United_States".
    The formula in data validation:
    Please Login or Register  to view this content.
    Here's an example:

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: Indirect Offset Data Validation

    This is an excellent alternative. However, note that you will still need a separate table for each vehicle type, and have to create and name a new table if you want to add a new vehicle type.

  7. #7
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,028

    Re: Indirect Offset Data Validation

    @StringJazzer
    Thanks for reviewing my code.
    There's another option which is using an UDF, without using actual Table.
    Example:
    Dependent data validation in A2:B7, the list in Country & City are dynamic.
    How to set it up:
    1. Insert this UDF in a code module:
    Please Login or Register  to view this content.
    2. Create a named range "COUNTRY", refer to: = 'SHEET2'!$A$2:INDEX('SHEET2'!$A:$A, COUNTA('SHEET2'!$A:$A), 1)
    3. You must select the first dependent cell i.e B2 then create a named range "toXDAV", refer to: =xdav(Sheet1!$A2,Sheet2!$C$1:$Z$1)
    4. Select A2:A7 create data validation > List > Source: =COUNTRY
    5. Select B2:B7 create data validation > List > Source: =toXDAV

    Note:
    In sheet2, the headers of the list are actually on C1:E1, but I set it to $C$1:$Z$1 in the formula, so you can add more Country without having to change the formula.

  8. #8
    Registered User
    Join Date
    10-04-2012
    Location
    Great Southern Land
    MS-Off Ver
    2010 - Excel, Access, Word, Outlook.
    Posts
    7

    Re: Indirect Offset Data Validation

    Thank you for explaining that INDIRECT does not work with dynamic named ranges.
    Thank you for the alternative solution. I like that this is concise and minimizes use of named ranges.
    I noticed that the range inside the MATCH formula was not dynamic and did not work when adding new categories eg motorcycle, trailer etc. I simply replaced the range with your named range of "vehicle" and it worked fine.
    Thank you for your help, this response answered my questions and more.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: Indirect Offset Data Validation

    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

    If a member helped you solve your problem, consider adding to their reputation by clicking on the star icon addreputationiconsmall.jpg below their name.

+ 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. [SOLVED] Offset Indirect Data Validation
    By jwillis07 in forum Excel General
    Replies: 7
    Last Post: 02-22-2019, 05:35 AM
  2. [SOLVED] Indirect Data Validation
    By mark888 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-21-2017, 04:56 AM
  3. Replies: 4
    Last Post: 04-02-2016, 07:12 AM
  4. Replies: 11
    Last Post: 03-31-2016, 03:40 PM
  5. Data validation using indirect
    By erisaaka in forum Excel General
    Replies: 1
    Last Post: 02-11-2014, 08:16 PM
  6. Replies: 2
    Last Post: 06-03-2013, 08:26 AM
  7. Data Validation with Indirect
    By Nigel in forum Excel General
    Replies: 3
    Last Post: 12-17-2005, 11:40 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