+ Reply to Thread
Results 1 to 19 of 19

Data Validation: Named Range as well as an additional value

  1. #1
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Data Validation: Named Range as well as an additional value

    I want to set data validation for a cell to a list like this:
    • All Cities
    • City 1
    • City 2
    • City 3
    • City 4...

    Where All Cities is an arbitrary value and the other entries are taken from the headers of a table (=INDIRECT("tbl_Cities[#Headers]")

    I need to somehow add the 'all cities' item to the other items in the validation list... I did a search on this and the only answer I found was a flat no. However I'm sure there must be some clever person who could come up with a solution... I need this for a community project I'm working on so any help would be much appreciated. Thanks.

  2. #2
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Data Validation: Named Range as well as an additional value

    My primary data manipulation language is SQL... is there an Excel equivalent of UNION?

  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
    52,938

    Re: Data Validation: Named Range as well as an additional value

    Hi and welcome to the forum

    I need to somehow add the 'all cities' item to the other items in the validation list
    what exactly do you mean by that?
    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
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Data Validation: Named Range as well as an additional value

    Well I need the data validation list to look like the attached image. The city names come from the table headers and the 'All Cities' value is added 'manually'. This help at all?
    Attached Images Attached Images

  5. #5
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Data Validation: Named Range as well as an additional value

    Don't know if you know SQL but if I was using that then I'd be doing
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Data Validation: Named Range as well as an additional value

    And thanks for the welcome...

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Data Validation: Named Range as well as an additional value

    If the table is like this and is called tbl_cities:

    All Cities City 1 City 2 City 3 City 4

    Go to the Name Manager, New, enter a name like Cities and enter in the formula field =tbl_Cities[#Headers]

    Select the cells where you want the Data Validation, go to Data Validation, List, and enter in the formula field =Cities

    The drop down list will be populated with the headers of the table.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Data Validation: Named Range as well as an additional value

    Thanks for the response. Unfortunately the 'All Cities' entry isn't in a column in the table...

  9. #9
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Data Validation: Named Range as well as an additional value

    See attached for an example of what I want. Thank you.
    Attached Files Attached Files

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Data Validation: Named Range as well as an additional value

    You don't give any indication of what you are really trying to accomplish. There is nothing wrong with the method that you produced the All Cities drop down list. If you want All Cities to be part of the list, add a column to the left of the table and give it the title All Cities. This is done by clicking one of the headings in the table then on the Table Design Tab, click on Resize Table and increase the range in the formula field to include the column on the left for All Cities.

    You give no idea of how you are going to use this listing so further information is difficult to give.

  11. #11
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Data Validation: Named Range as well as an additional value

    What I typically do when I want a dynamic named range that is using something like a pivot table to grab the names is have a blank (as in cleared) drop down equivalent to all. I make a note of it in the dashboard and everyone seems get it quickly. Then instead of referencing the drop down you can reference a hidden cell with an * in it. Or if you are using it for a complex sumifs you can have an If statement to remove that criteria range and criteria from the formula all together.

    If this is NOT a dynamic named range then what I would do is create a lists tab and and make the list there manually, once. Link the data validation two THAT list and move on.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  12. #12
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Data Validation: Named Range as well as an additional value

    OK. Thanks for everyone's help.
    I'm sorry my explanation caused confusion but I don't really see how I can explain it any better... I'll probably go with the extra column on the table (not an ideal solution but probably the easiest).
    Thanks again.

  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
    52,938

    Re: Data Validation: Named Range as well as an additional value

    So, "all cities" is just that, the sum of all the other "named" cities, and not an actual category?

    Not sure if you plan on summing or counting, but perhaps we could put an IF () statement together that would sum(?) all the values if "all cities" was sdelected, and individual cities get summed(?) if a city was selected?

  14. #14
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Data Validation: Named Range as well as an additional value

    @FDibbins, I don't really know that I understand exactly what you're saying but this is only for a reference field. No calculations are involved. (You are correct about All Cities not being a category)
    I simply wanted the user to be able to chose one city from the table or else choose 'all cities' but obviously this isn't possible. Thanks anyway.
    Last edited by jakethepeg1; 12-01-2013 at 04:21 PM. Reason: Clarified some ambiguity

  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
    52,938

    Re: Data Validation: Named Range as well as an additional value

    Thats pretty much what I meant, and yes I know that is a ref cell, but im sure you will have a calc of something based ON that cell?. If you have...
    All Cities (no entry is actuaLLy this)
    City 1
    City 2
    etc
    if ALL is selected, then it will include all cities in whatever calc is done . See if the attached is what you want?
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Data Validation: Named Range as well as an additional value

    Thanks for your effort. That's the result I want however the cities list needs to be dynamic (taken from the header rows of a table which a) can be changed and b) can be added/removed).

  17. #17
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Data Validation: Named Range as well as an additional value

    The enclosed is a small example of Cascading drop down dynamic lists that you may adapt to your situation.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    08-14-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Data Validation: Named Range as well as an additional value

    Thank you for this reply. I have used these before however I hadn't thought of using them in this context so thanks for that suggestion: I'll give it a go.

  19. #19
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Data Validation: Named Range as well as an additional value

    Thanks for the feedback.

    Good luck with your project.

+ 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. Named Range - Data Validation List
    By Tarball in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2010, 12:34 PM
  2. Using a named Range in Data Validation
    By Befuddled in forum Excel General
    Replies: 2
    Last Post: 02-11-2010, 11:07 PM
  3. Data Validation & Named Range
    By Dylan&Hayden in forum Excel General
    Replies: 5
    Last Post: 05-10-2008, 05:23 PM
  4. [SOLVED] Data validation named range update
    By Phil Deem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2005, 10:05 AM
  5. [SOLVED] Data validation named range update
    By Phil Deem in forum Excel General
    Replies: 3
    Last Post: 07-15-2005, 11:05 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