+ Reply to Thread
Results 1 to 10 of 10

Data Validation List by Formula

  1. #1
    Forum Contributor
    Join Date
    09-05-2009
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    156

    Data Validation List by Formula

    Happy New Year to all!

    I have created 6 seperately named lists of contacts for six different offices. In this case, the lists are named 'HQ', 'SE', 'SW', 'MID', 'NORTH' and 'SCOT'. I am trying to have the appropriate dropdown list in one specific cell (C23) which is populated according to the region selected in another cell (C5). For instance, I have tried the following formula as the Source in the Date Validation Settings tab (having first chosed 'List'):

    =IF($C$5="HQ",=HQ,IF($C$5="South East",=SE,IF($C$5="South West",=SW,IF($C$5="Midlands",=MID,IF($C$5="North",=NORTH,IF($C$5="SCOT",=SCOT,""))))))

    Perhaps this is not possible or the formula needs a tweak or there is another solution? Any suggestions appreciated.
    Last edited by kborgers; 01-02-2011 at 08:58 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Data Validation List by Formula

    Try removing the = operator before each Named Range reference.

    If the Named Ranges are not Dynamic and are in fact hard wired references (Sheetx!A1:B10) you might find you can use:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-05-2009
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    156

    Re: Data Validation List by Formula

    Hi DonkeyOte, hope you're well!
    I tried without the equals sign and got the meassage, 'The list source must be a delimited list, or a reference to a single row or column.'. So, without the equals, I at least get something better than 'The formula you typed contains an error'! However, I have no idea what a 'delimited' list is and your suggested alternative of '=INDIRECT($C$5)' is also beyond my knowledge. Would you be able to expand a little please?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Data Validation List by Formula

    Did you try the INDIRECT option (this would replace your existing formula in full)

    If in doubt best to post a sample file which mimics the set up you have.

    If you can't do that please specify how the Named Ranges have been created - ie the RefersTo: value for say HQ & SOUTH EAST

    On a final note - are you using ; delimiters or , ?

    P.S. I'd recommend you not use MID as a Named Range if you're using the English function names

    edit: ignore the INDIRECT - given C5 contains the long version rather than Named Range name
    Last edited by DonkeyOte; 01-02-2011 at 06:45 AM.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Data Validation List by Formula

    OK - I've had my mid morning cup of tea now and the brain is functioning...

    Remove the Null from your formula and try again (assuming , delimiter)

    Please Login or Register  to view this content.
    (I'd probably rename MID myself)

    If the option selected in C5 is not one of the above there will be no DV options from which to select.

  6. #6
    Forum Contributor
    Join Date
    09-05-2009
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    156

    Re: Data Validation List by Formula

    I have attached an example of what I am trying to achieve (and renamed 'MID' to 'MIDLANDS'). Hope this is clear! In this example, I want the list in a dropdown box in B2 to match the Selected Region in cell B1.
    Attached Files Attached Files

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Data Validation List by Formula

    Per sample - the formula from the prior post should work if you revise:

    a) references to C5 to B1

    b) reference to MID to MIDLANDS

    of course this assumes you want the A.N.OTHER entries to appear when DV is active.

  8. #8
    Forum Contributor
    Join Date
    09-05-2009
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    156

    Re: Data Validation List by Formula

    Thanks DonkeyOte. Two wierd things happening here. Firstly, in the example (with the changes you mention in your last post), this almost works (attached). If I select HQ in B1, the first name that appears in the dropdown box in B2 is 'Joe Bloggs which is correct. If I then select 'South East' in B1, I then have 'Jane Smith' as the first choice in B2 which is also correct, and so on if I continue to select each region in order continuing down to Scotland. However, if I go out of sequences; ie. Select 'North' after 'South West', which means that I have missed out 'Midlands', then the dropdown box does not work.
    The second odd point, is that by using the exact same formula (with corrected cell reference to region - C5 instead of B1), it does not work at all in my actual spreadsheet. I just get the mesage 'The list source must be a delimited list, or a reference to a single row or column.'. At the moment, I am using exactly the same lists for both the actual spreadsheet and the sample as posted.
    Attached Files Attached Files

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Data Validation List by Formula

    Referring to the issues you outline in your above post re: latest sample file

    Note the following:

    a) G9 : you have a trailing space: "North " <> "North" -> hence no DV options when "North " is Selected -> modify G9

    b) G10: mismatch between DV options and formula -> "Scotland" <> "Scot" -> hence no DV options when Selected -> modify formula "SCOT" to "Scotland")

  10. #10
    Forum Contributor
    Join Date
    09-05-2009
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    156

    Re: Data Validation List by Formula

    Silly errors on my part, which I shall write down to New Year excesses. Many thanks for your studious help (not for the first time!). All working fine now, including my actual sheet. Thanks again Donkey Ote and I wish you a suuccessful 2011!

+ 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