+ Reply to Thread
Results 1 to 15 of 15

Drop-down list starting from middle

  1. #1
    Registered User
    Join Date
    04-13-2010
    Location
    Panama, Panama
    MS-Off Ver
    Excel 2007
    Posts
    30

    Drop-down list starting from middle

    Hello all,

    I've got a lot of drop-down lists in my file. When you click on the little arrow, I'd like the options to show up starting from the first option in my list. Right now they are starting from the middle of the list (example: The drop-down in B1 refers to drop-down list defined as A1:A10. A1:A5 of the drop-down list has items filled in, and A6:A10 are left blank so I can fill in more options later; the arrow activating the drop-down list in B1 shows options starting at A6. I'd like it to start showing the options at A1).

    Is there an option so that the drop down will start at the first cell included in the list?

    Thanks,
    smalls
    Last edited by smalls; 09-29-2010 at 04:14 PM. Reason: Issue resolved.

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

    Re: Drop-down list starting from middle

    There are some cool "tricks" for making the drop down lists expand themselves without manual adjustment and NOT leave any blanks.

    The easiest way is to have your lists on a separate resource sheet, I call my resource sheet LISTS. Then I used NAMED RANGES to define my list.

    So, on sheet LISTS I put some values in column A.
    Then select Insert > Name > Define
    In the top bar enter a name for this list, like OPTIONS.

    In the Refers To: bar insert this dynamic expansion formula:

    =$A$1:INDEX($A:$A,COUNTA($A:$A),1)


    Then in the cell where you want the drop down, use Data > Validation> Allow: List > Source: =OPTIONS.

    This named range will expand itself as you add items into column A on your resource sheet.
    Last edited by JBeaucaire; 09-29-2010 at 02:35 PM.
    _________________
    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!)

  3. #3
    Registered User
    Join Date
    04-13-2010
    Location
    Panama, Panama
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Drop-down list starting from middle

    Thanks, Jerry! This is very helpful and I will keep in mind for future uses. One questions, though: you mention that you know of "a few" cool tricks for this. Do you know any that do not involve the dynamic expansion?

    The reason I ask is that I actually do have a separate tab, coincidentally also called "lists". It's got about 25 or 50 different lists on it. If there's another option for getting the drop-down to appear from the top, I'd rather do it that way instead of creating new formulas to re-name all the lists.

    In addition, the formatting on these lists is such that it is clear to the people who will run this model where they can and cannot input more options in each of these lists (i.e. a blue box A1:A10 where A1:A5 are full, but A6:A10 are empty but still blue so it is clear you can input more options). I know I could maintain this formatting and still do it using dynamic expansion as per your suggestion, but if it's possible to do it using the set area I've already defined as the list, that would be most useful.

    Thanks again!
    smalls

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

    Re: Drop-down list starting from middle

    I would use a single column for each list, not colored boxes. If you want to be clear what each list is for, put the name of the list in row 1 and start the dynamic listing at row2:

    =$A$2:INDEX($A:$A,COUNTA($A:$A),1)

    Do this once and it will work for you flawlessy forever. I wouldn't use any other technique.

    NOTE: As long as you manually create name ranges with blanks in them, then when you use that name in a DV list it will always show you the current selection...and when the cell is empty that's a blank so it will show you a blank row. That's just the way it is.

    Which is why I use dynamic name ranges to eliminate this problem once and for all.
    Last edited by JBeaucaire; 09-30-2010 at 09:33 AM.

  5. #5
    Registered User
    Join Date
    04-13-2010
    Location
    Panama, Panama
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Drop-down list starting from middle

    OK, thanks very much!

  6. #6
    Registered User
    Join Date
    04-13-2010
    Location
    Panama, Panama
    MS-Off Ver
    Excel 2007
    Posts
    30

    Question Re: Drop-down list starting from middle

    Hi Jerry,

    I marked this "solved" but maybe I shouldn't have. I'm trying to use the formula but it doesn't work--perhaps it is due to a difference in versions of Excel. I am using 2007, and there is no option for "Name" and then "define" under "insert. I tried right-clicking and then selecting "Name a range", which gave me a box like the one you described and input the formula. When I try to enter the list name in Data Validation it says "The source must be a delimited list, or a reference to a single row or column."

    When I look in the Name Manager the lists I've created using the method described above do, in fact appear. Unsure where I am going wrong. Any advice would be much appreciated.

    Cheers,
    smalls

  7. #7
    Forum Contributor Charlie_Howell's Avatar
    Join Date
    09-27-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: Drop-down list starting from middle

    when you choose data validation then "List", put the formula in "Source"

  8. #8
    Registered User
    Join Date
    04-13-2010
    Location
    Panama, Panama
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Drop-down list starting from middle

    Thanks, yes, that's what I'm doing and it produces that error message.

  9. #9
    Forum Contributor Charlie_Howell's Avatar
    Join Date
    09-27-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: Drop-down list starting from middle

    upload an example for us

  10. #10
    Registered User
    Join Date
    04-13-2010
    Location
    Panama, Panama
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Drop-down list starting from middle

    Charlie,

    Thanks for your response. I managed to solve the above problem before seeing your message, but now I'm confronted with a new one! It seems that using Jerry Beaucaire's (great!) solution affects formulas in my data validation--I'm using some indirect formulas to refer to lists in data validation and when I use these dynamic ranges it appears that the indirect formula cannot reference it.

    Here, I upload an example (unfortunately my data is sensitive so I can't upload my real model).

    If anyone knows what the problem is here, please let me know!

    Cheers,
    Smalls
    Attached Files Attached Files

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

    Re: Drop-down list starting from middle

    You are correct. Dynamic Named ranges cannot be indirectly referenced. It simply won't work. You'll have to decide what gives you the most functionality.

  12. #12
    Registered User
    Join Date
    04-13-2010
    Location
    Panama, Panama
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Drop-down list starting from middle

    Bummer! Well, thank you for confirming.

    I ended up finding a solution, though--I inserted a blank cell into the top of all my lists, and so the drop-down menus start from there instead. The first cell is blank, but at least the choices all show up, which is what I needed for my (admittedly non-excel-expert) users. I used the entire column as the list, as suggested by JBeaucaire, so that there is lots of space for new options.

    Cheers and thanks for the help, all.
    Last edited by smalls; 10-06-2010 at 04:00 PM.

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

    Re: Drop-down list starting from middle

    Actually, you don't have to choose. INDIRECT() can be replaced with a dynamic formula IN the DV formula itself to pull all the items out if you put all your lists together into one sorted list.

    All that is needed is that the first column be sorted ascending and have an entry for each final "item" you want to select.

    The attached workbook uses dynamic name ranges to create a range for Category and Categories and Items. The INDIRECT() has been taken out and now it works fine.

    It even allows for a default message to be used if the Type column is accessed while the Category is empty.

    The technique is explored more on my website here.

    As you add to you master list later, just add to the bottom and sort.
    Attached Files Attached Files
    Last edited by JBeaucaire; 10-06-2010 at 04:12 PM. Reason: Added DV list to the categories column

  14. #14
    Registered User
    Join Date
    04-13-2010
    Location
    Panama, Panama
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Drop-down list starting from middle

    Ok, thanks. This looks like it could be another good solution. But going back to the initial question, if I want to leave each list "open-ended", so that more options can be added in afterward, I will have to either insert rows or re-sort based on category, correct?

    For example, adding "Fruits" and "Lemons" at the end of the list (G15, H15) doesn't work, but inserting it after the last Fruits (G7, H7) does.

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

    Re: Drop-down list starting from middle

    Add them at the bottom, as many as you wish, then highlight both columns and sort. Easy-peezy.

+ 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