+ Reply to Thread
Results 1 to 22 of 22

Data Validation (List) too long

  1. #1
    Registered User
    Join Date
    09-04-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Data Validation (List) too long

    I am trying to create a drop down list that see's the entry to left of it and brings down the appropriate list.
    My code is as follows:

    Please Login or Register  to view this content.
    This works just fine.

    However, I need to add more to the code as my list to pick from has gotten longer. My problem is that the code is too long.
    I have read from other sources that one can put the code simply in the workbook and name it then reverence back to it.
    This does not work for me as when I put the code in the sheet, without it trying to create a list, it doesn't make sense. So if I try to reference back to it in list, it returns #VALUE.

    Is there any kind of work around that I can do to accomplish more characters to a drop list in data validation?
    Last edited by Versial; 09-04-2012 at 01:36 AM.

  2. #2
    Registered User
    Join Date
    09-04-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Data Validation (List) too long

    Also, to the original post, I have shortened the range names a single letter, so they cannot be any shorter.

  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
    48,089

    Re: Data Validation (List) too long

    Use CHOOSE.

    See: http://www.techonthenet.com/excel/formulas/choose.php

    Regards, TMS

    Edit: another link with examples: http://www.myonlinetraininghub.com/e...hoose-function
    Last edited by TMS; 09-04-2012 at 01:49 AM.
    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


  4. #4
    Registered User
    Join Date
    09-04-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Data Validation (List) too long

    I don't understand how this helps. I don't want it to pick something automatically.

    Here is what I am trying to accomplish:

    Column A is a list that you can choose 1-20
    Column B needs to generate a list from the choice in Column A
    Example:

    If you choose 1 in Column A, Column B pulls a list of A,B,C,D to choose from
    If you choose 2 in Column A, Column B pulls a list of E,F,G,H to choose from

    One list generates the next.

    From what I understand about CHOOSE is if it sees 2, then it puts B.
    I can understand if it sees 2 (out of a choice of 1-20) that it pulls list B.

    Maybe I am not understanding choose correctly, but I cannot get this to work.

  5. #5
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    511

    Re: Data Validation (List) too long

    it may help if you upload an example of your file

  6. #6
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    511
    Last edited by Toonies; 09-04-2012 at 03:24 AM.

  7. #7
    Registered User
    Join Date
    09-04-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Data Validation (List) too long

    I want to do exactly what the guy posted in

    http://www.myonlinetraininghub.com/e...ependent-lists

    My problem now is the names I would have use involve numbers and more than 1 word.
    I cannot name my ranges with numbers or more than 1 word, so INDIRECT is not working for me as he has it shown.
    I would remove the numbers and consolidate the words but they are kind of pointless and look stupid without them.
    For example:
    1st BCT
    127 ASB
    and so on....

    They are names for things already so my ranges names are a little weird so as not to include the numbers and such as you can probably tell from my formula that looks like gibberish.

    But yes that is EXACTLY what I am looking to accomplish.

    As stated in my first post, I have the formula to do it, but it is too long. Is there a way that I can put the formula in the worksheet and reference back to the FORMULA and not it's VALUE. Like i want the cell to hold the formula but not solve it.

    Sorry to be so much of a pain but I don't want to go the tacky route and put all the values of column be available unless they make sense to be there.

  8. #8
    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
    48,089

    Re: Data Validation (List) too long

    Clearly, Toonies has a better grasp of your requirements than I do. You provided a long nested IF statement ... I was trying to help make that more scalable using CHOOSE. It wasn't obvious to me that FBCTBNS, etc., were named ranges, nor that what you wanted was dependent drop down lists ... my bad.

    I would urge you to follow Toonies' recommendation and update a sample workbook. That will make life easier for both of you.

    On that note, I'll back off.

    Regards, TMS

  9. #9
    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
    48,089

    Re: Data Validation (List) too long

    I believe you can start the Named Range name with an underscore (_). So you could have _1st_BCT.

    To overcome the spaces in the name issue, you would need to use SUBSTITUTE and replace spaces with underscores.

    If for example, your selection was 1st BCT in cell A1, then you'd use something like =INDIRECT("_" & SUBSTITUTE(A1, " ", "_")) and the name of the Named Range would be _1st_BCT.

    All untested, but that's the theory. Not going to get tested without a sample workbook.

    Regards, TMS

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data Validation (List) too long

    Maybe this technique can help and eliminate the need to use INDIRECT at all.

    http://www.excelforum.com/showthread...43#post2845843
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  11. #11
    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
    48,089

    Re: Data Validation (List) too long

    @JB

    I get an error if I try to follow that link:


    vBulletin Message
    TMShucks, you do not have permission to access this page. This could be due to one of several reasons:

    Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
    If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.


    Why would that be?

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data Validation (List) too long

    Checking now as to that error.

    @Versial - post your workbook and I'll show you how to apply this. This basically replaces the INDIRECT() methodology with a data validation formula that uses OFFSET() to find where the secondary list should start and stop on its own. You don't need to predefine a bunch of ranges.

  13. #13
    Registered User
    Join Date
    09-04-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Data Validation (List) too long

    I tried the &SUBSTITUTE in quick test, didn't work at first try but I don't have time to experiment with it right now. May try more later.

    I have attached my sample workbook, you will see the main list is BDE, all the names in BDE (10 in this sample), have a corresponding sub-list. They are notable by BN's at the end of it. I have removed all the names for the ranges except for BDE and OTHER, as I don't know if they will play a role in how you can help.

    I also have the list in $A14 for BDE and $B14 for what should be the corresponding BN list.

    Book1.xlsx

    I have been really surprised with how helpful this forum is and how quick the responses have been. Thank you guys for the help you have provided and in advance.

    Also adding underscores allowed me to put in numbers and spaces, I did not know you could do this before, again thank you.
    Last edited by Versial; 09-04-2012 at 10:20 AM.

  14. #14
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Data Validation (List) too long

    pl see the attached file
    You have to use the following formula irrespective of any number of RANGES .

    Formula used for validation

    Please Login or Register  to view this content.
    You need not make any changes in ranges or names.
    Hope this will help.
    Thanks.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    09-04-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Data Validation (List) too long

    This seems like a valid work around but it doesn't work right. I am assuming it is using the numbers or best match to determine what to choose from, in my case for example there are two "1's". 1 BCT & 1 CAB. It can't seem to tell them apart. So if I pull up 1 CAB I get the list that goes with 1 BCT. I will upload my updated workbook with your formula. I do however like the idea that maybe I can choose from them in order (this is what I thought was accomplished with this formula), as long as the order of the BDE list matches the same order of the corresponding list.

    I hope that makes sense

    Book1.xlsx

  16. #16
    Registered User
    Join Date
    09-04-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Data Validation (List) too long

    I looked more into match so I could understand the formula and edited to this:
    Please Login or Register  to view this content.
    By adding the "0" at the end it tells it to look for EXACT match and is seems to interpret underscores like in _1_BCT to spaces "1 BCT".
    So what I am saying is....IT WORKED!!!!

    Thank you so much I have been getting frustrated.

  17. #17
    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
    48,089

    Re: Data Validation (List) too long

    Thanks for the rep.

    Regards, TMS

  18. #18
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data Validation (List) too long

    I know I'm late to the party, but I did promise a "no-indirect-solution". Here it is.

    By putting all your lists on a separate page like shown, you can use a single dynamic named range "Titles" to make a list of the row1 values for your first DV Drop down. As you add more columns, the list expands itself.

    Then on the SHeet1 B2 cell, all the plumbing is built into the DV formula itself. It spots which value in A2 was selected, finds it on the Lists sheet row1, then makes a DV list of all the other values in that same column.

    =OFFSET(INDEX(Titles,MATCH($A2,Titles,0)),1,,COUNTA(OFFSET(INDEX(Titles,1),,MATCH($A2,Titles,0)-1,1000,))-1)

    Make sure there is a value in A2 when you first enter that formula to avoid an irrelevant error message.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    09-04-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Data Validation (List) too long

    Thank you JBeaucaire for that extra bit seems like an easy way to get this done for many more types.

  20. #20
    Registered User
    Join Date
    02-23-2018
    Location
    Kansas City, Kansas
    MS-Off Ver
    2007
    Posts
    1

    Re: Data Validation (List) too long

    I hate to drag this thread out of the grave but I'd love some help. I've read all the post above and downloaded all the examples but I really don't understand how they work.

    I am trying to put a huge formula into the Data Validation "Source:" field but it is too long. I need to fit this into a 255 character space...
    Please Login or Register  to view this content.
    I'll include my file in case anyone is interested in looking at it with me.

    Essentially my issue is the same as the original poster's but I don't not understand how he solved his issue.
    Attached Files Attached Files

  21. #21
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,933

    Re: Data Validation (List) too long

    TFears,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ben Van Johnson

  22. #22
    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
    48,089

    Re: Data Validation (List) too long

    Instead of using CONCATENATE use an ampersand (&) between the cell addresses, etc

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


    But note ...

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ 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