+ Reply to Thread
Results 1 to 19 of 19

Indirect Validation - using data in second worksheet

  1. #1
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    310

    Indirect Validation - using data in second worksheet

    Hi Excellers!
    I have a competition entry form for an association I belong to that I'd like to add two drop down menus to so that entrants can select their club name and associated team names for that club.
    In a worksheet behind the form I have a list of clubs in column "B" ("A" has the ID number in it as the table is from Access - don't ask!!) and the names of teams associated with that club going across the sheet beside the club name in individual Name Ranges. (Up to 30 Team names in Dynamic lists =OFFSET(TeamsTest!$C$2,0,0,COUNTA(TeamsTest!$C$3+TeamsTest!$C$3:$AZ$3),1) )
    On the form I have managed to make the first drop down so the club can select its name from a list by using Data Validation and referring to the Range Name (ClubLink - =OFFSET(TeamsTest!$B$2,0,0,COUNTA(TeamsTest!$B$2:$B$200),1)). I have tried using an INDIRECT command to create a second drop down which will display only the team names associated with the Club selected in the first drop down, but can't get it to do anything - no drop down appears when you click on the drop down arrow at the side of the cell
    The data Validation for the Team Name drop down is =INDIRECT(SUBSTITUTE($C$12," ","")) where C12 is the Club Name cell.
    Any ideas why I can't get the Team Name cell to show the names listed beside the Club selected in C12?
    Thanks

    Frankie

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Indirect Validation - using data in second worksheet

    COUNTA(TeamsTest!$C$3+TeamsTest!$C$3:$AZ$3) evaluates to error
    have you followed the instructions here?
    http://www.contextures.com/xlDataVal02.html
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Indirect Validation - using data in second worksheet

    Hi and welcome to the forum

    You probably have this already, but DV in 2003 cannot reference another sheet directly, it needs to use a range name for that reference.

    If you already have the named ranges, check for any leading/trailing spaces and spelling.

    If all else fails, upload a (clean) sample workbook here and I will take a look at it for you
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    310

    Re: Indirect Validation - using data in second worksheet

    Thanks for the responses but I think I may have to abandon the idea! After a bit more digging and experimenting it appears that not only can't you use Data Validation with a Dynamic Name list, but lists can only be in columns.
    The original idea was to try and make up-dating the Club / Team list easier (i.e. won't have to reset the length of the Name list) for people with even less knowledge of Excel than me (!!) but it will just get toooooo complicated!
    Thanks again

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Indirect Validation - using data in second worksheet

    you can use dynamic ranges across rows to create a dropdown, what makes you say you cannot?
    Attached Files Attached Files
    Last edited by martindwilson; 01-16-2014 at 07:49 PM.

  6. #6
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    310

    Re: Indirect Validation - using data in second worksheet

    Hi Martin
    My issue is with selecting a row across using an Indirect link through the Club selected in another DV cell. I've tried to re-create what I've currently got in the attached workbook

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Indirect Validation - using data in second worksheet

    the DV formula for the 3rd DD is missing something...
    You have...=INDIRECT(SUBSTITUTE($B$6," ",""))
    should be...=INDIRECT(SUBSTITUTE($B$6," ","")&"Teams")

  8. #8
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    310

    Re: Indirect Validation - using data in second worksheet

    EXCELLENT!!! Thanks Mr. Dibbins and Mr. Wilson!!

    Don't suppose you can make the DV work with a Dynamic list now can you??

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Indirect Validation - using data in second worksheet

    Try changing the formula you have in the Name Manager in "refers to" (in club, for instance) to this...
    =OFFSET(Sheet4!$C$4,0,0,COUNTA(Sheet4!$C:$C),1)

  10. #10
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    310

    Re: Indirect Validation - using data in second worksheet

    Yes. That works for the Clubs column thanks. What of the Teams list in the rows across the columns? I tried to modify Club6 "refers to" data with =OFFSET(Sheet4!$D$9,0,0,COUNTA(Sheet4!$9:$9),1) thinking it would get down to the row and then look all the way across, but with this in place the third DV at B10 (which relates to the club selected in B6) won't drop down.
    PS I added another three Clubs to the list to test the dynamic and then added another 3 teams to Club6

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Indirect Validation - using data in second worksheet

    Is there any reason why the "row" of data cannot also be a "column" of data? (just to keep things in the same format)

  12. #12
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    310

    Re: Indirect Validation - using data in second worksheet

    The spread sheet data I have is a collection of some 40 clubs that each have a selection of Teams against their name. A club may have a couple of team names against them or in one case, one club has 28 team names against it. I did have the Club names across the first row with the team names down the column below the club name, but the organiser who looks after the web site and is keeper of the Master copy of the data, wanted it in clubs down/ teams across format. If we can make the dynamic listing work in the Clubs across / Teams down format, I'm willing to try and get it changed, but I thin it's something to do with the original data coming out of an Access Database where it appears it has to be Club down / Team across.
    The Club/Teams data on the spread sheet is used behind various forms we use where we don't want people entering variations of spelling or hieroglyphics Club & Team names!

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Indirect Validation - using data in second worksheet

    Seeing as this isnt really solved yet, I have marked it UNSOLVED

    Im a little confuzzled here as to which drop-down is which. The yellow, green and orange all seem to be working fine...what am I missing here?

  14. #14
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    310

    Re: Indirect Validation - using data in second worksheet

    The Yellow was the one Martin Wilson kindly did as an example, but it only went the first step. I then put in the Green one that is the Club Selection (Club1 / 2 etc) with the Orange one as the Team selector, driven by the selection in the Green one. They do both work without a problem thanks to the inputs from you both; However...... I wanted to make the Name lists on Sheet 4 Dynamic, so that every time you go in to add a Club or Team you don't have to change the parameters in the Name Manager. I had left a couple of blank cells at the end of each team list, but these then show up on the drop down and, where there is a long list of teams, was causing confusion with some of the users as the team names didn't actually appear unless you scrolled up the drop-down list (!! - Not very savvy some of our users!!). Going to a dynamic Name list seemed the way to go as the Clubs quite often enter different teams into competitions, but I read somewhere that you can't use the DV INDIRECT function where there is a dynamic Names list.

  15. #15
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Indirect Validation - using data in second worksheet

    OK I think I have it now. I changed your data slightly to make it easier (for me anyway) to test against

    Take a look at the attached and see if this is what you want? The only range names you need now are "clubs" and "Teams"

  16. #16
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    310

    Re: Indirect Validation - using data in second worksheet

    Hmmm.... Lost me here. The orange drop down doesn't do anything and there appears to be no DV in the cell. If I take the apostrophe away from the formula in cell D10 on sheet 1 it appears to just give a result from the first column after the Club selected in the green drop down.
    Also, I can't see where the Name Range "Teams" is in Name Manager
    I had to re-name the file as it wouldn't open with the exceedingly long name it came off the site with.

    Second Test from ExcelForums.xlsx

  17. #17
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Indirect Validation - using data in second worksheet

    Hmm not sure what went wrong there, Im sure the file I (indended to?) uploaded had some extra text in it. No Matter, I used the same approach in the attached.

    1st, I created a named range called dropdown3 (imaginative, right? lol) and used this in teh "refers to" part...
    =OFFSET(Sheet4!$C$1,MATCH($B$6,Sheet4!$C:$C,0)-1,1,1,COUNTA(INDIRECT("sheet4!"&MATCH($B$6,Sheet4!$C:$C,0)&":"&MATCH($B$6,Sheet4!$C:$C,0))))

    Then I used the dropwdown3 name in the DV list

    I notice that the file you uploaded indicates 2007 or later (.xlsx), but your profile says 2003. Please update your profile as necessary, members tailor questions based on your excel version.
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    310

    Re: Indirect Validation - using data in second worksheet

    Thanks for that. I'll give it a bit of a study to try and understand it then put it into my form. At least it works anyway!
    Frankie

  19. #19
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Indirect Validation - using data in second worksheet

    Just to get you started, it looks far worse than it really is - you kisy need to break it fdown into component parts....

    =OFFSET(Sheet4!$C$1,MATCH($B$6,Sheet4!$C:$C,0)-1,1,1,COUNTA(INDIRECT("sheet4!"&MATCH($B$6,Sheet4!$C:$C,0)&":"&MATCH($B$6,Sheet4!$C:$C,0))))

    =offset(starting-reference,rows-down-from-start-ref,columns-across-from-start-ref,range-height,range-width)
    based on that, with club1 seletced, we would need...
    =offset(sheet4!$C$1,3,1,1,4)
    offset(sheet4!C1 (ya gotta start somewhere),
    3 (club1 is 4 rows down, including row1)-1, so we use match to find that row number
    1 (start in that column)

    Now we come to the tricky part. We know the range is only 1 row high, so we use 1 for that, but the number of columns to use will vary.
    For that we need to 1st ID which row to use using MATCH.
    But we need 2 reference points for this, to count the cells, so we need to put the MATCH() inside an indirect, to give the range for the counta()

    Pretty much what I did was run the calc "manually", entering the values that we needed. Then when I knew what values were, I built finctions that would give me those values

+ 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. Copy indirect validation from one worksheet to another..!
    By Rhythm089 in forum Excel General
    Replies: 0
    Last Post: 07-13-2012, 01:01 AM
  2. Indirect Data Validation
    By techteam in forum Excel General
    Replies: 3
    Last Post: 11-22-2011, 07:03 AM
  3. Data Validation and Indirect
    By matt_the_brum in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2006, 09:53 AM
  4. Data Validation with Indirect
    By Nigel in forum Excel General
    Replies: 3
    Last Post: 12-17-2005, 11:40 AM
  5. [SOLVED] Indirect formula using Data Validation List of Worksheet Tabs
    By Scott in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-05-2005, 11:10 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