+ Reply to Thread
Results 1 to 19 of 19

Exclude a specific value from drop down list

  1. #1
    Registered User
    Join Date
    10-09-2019
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    29

    Exclude a specific value from drop down list

    I have a table where I have staff names. I use these staff name to create down down list using INDIRECT formula and it works perfectly.

    Now I want to create a new drop down list, but want to exclude few specific staff name and show rest of the staff names.

    I using below formula but I get an error "You may not use reference operators (such as unions, intersections and ranges) or array constants for Data Validation criteria"

    =OFFSET((INDIRECT("STAFF_NAME[Name]")),0,0,12,1),OFFSET((INDIRECT("STAFF_NAME[Name]")),13,0,MAX(1,COUNTA(INDIRECT("STAFF_NAME[Name]")))-13,1)

    Table name = STAFF_NAME
    Column name (within the table) = Name

    How to fix the error?

    Plus I know my formula only exclude the name if its in 14th position, if there is a way to ensure name can be anywhere in the data it will be excluded will be awesome.

  2. #2
    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,926

    Re: Exclude a specific value from drop down list

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    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

  3. #3
    Registered User
    Join Date
    10-09-2019
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    29

    Re: Exclude a specific value from drop down list

    In cell E8 I want to have a drop down list, which exclude names in row 6 to 8.
    The formula I mentioned above gives me an error.

    Not sure what formula I should have?
    Attached Files Attached Files

  4. #4
    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,926

    Re: Exclude a specific value from drop down list

    OK so how would excel know you want to exclude certain names?

  5. #5
    Registered User
    Join Date
    12-18-2019
    Location
    Maracaibo, Venezuela
    MS-Off Ver
    2016
    Posts
    6

    Re: Exclude a specific value from drop down list

    Hi, try this

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Exclude a specific value from drop down list

    Your explanation is incomplete. As Ford asked: how is Excel supposed to know that those 3 names are to be excluded? Is it always rows 6 - 8? Or are there other criteria that are used, which you have not yet told us about?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Registered User
    Join Date
    10-09-2019
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    29

    Re: Exclude a specific value from drop down list

    I have updated the file.
    Added a Team Name column and want to include only staff name in Team "AUS"

    Thanks for the VBA solution . I was not looking for a VBA solution, as got heaps of places where I want similar type of drop downs.
    Attached Files Attached Files

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

    Re: Exclude a specific value from drop down list

    1 way to do this would be too add a helper column to pull out those names that you want, then use that column for the DD.

    I put AUS in C1 (as a constant that you can change), this...
    N1=IFERROR(INDEX(A:A,SMALL(IF($B$2:$B$10=$C$1,ROW($A$2:$A$10)),ROWS($A$1:A1))),"")
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Use those values for the DD

  9. #9
    Registered User
    Join Date
    10-09-2019
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    29

    Re: Exclude a specific value from drop down list

    Thanks for your help, but I wanted to have a table for the staff name and team names. As table makes it easy to add new names in the list.

  10. #10
    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,926

    Re: Exclude a specific value from drop down list

    Quote Originally Posted by saurab8 View Post
    Thanks for your help, but I wanted to have a table for the staff name and team names. As table makes it easy to add new names in the list.
    Yes, and my suggestion wont work with that...why?

  11. #11
    Registered User
    Join Date
    10-09-2019
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    29

    Re: Exclude a specific value from drop down list

    Buddy table does not accept fixing cell referencing.
    I might have to adjust your formula a bit (not sure 100% how) for create table referencing.

  12. #12
    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,926

    Re: Exclude a specific value from drop down list

    Not sure what you mean by Buddy table, but see if you can adapt this to your needs. The helper column (H) can be hidden if needed.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    10-09-2019
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    29

    Re: Exclude a specific value from drop down list

    Thanks for your help.

  14. #14
    Registered User
    Join Date
    10-09-2019
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    29

    Re: Exclude a specific value from drop down list

    hi guys.. above solution worked if I have to restrict data based on one column value. If I try to use multiple column value to restrict the data I keep getting error message.
    Is it possible at all to filter data based on multiple values, all located in different columns?

  15. #15
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,532

    Re: Exclude a specific value from drop down list

    It may help if you upload a file that illustrates what is meant by "use multiple column value to restrict the data".
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  16. #16
    Registered User
    Join Date
    10-09-2019
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    29

    Re: Exclude a specific value from drop down list

    Thanks for the reply.
    Attached is the file, and will like to have a drop down with names which are in AUS and Full Time.

    Prefer not to use VBA, as got way too many codes in my file already.
    Attached Files Attached Files

  17. #17
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,532

    Re: Exclude a specific value from drop down list

    The formula that produces the list from which the drop down is populated is itself populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The source for the data validation is: =OFFSET(N$2,0,0,SUMPRODUCT(--(N2:N10<>"")),1)
    Let us know if you have any questions.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    10-09-2019
    Location
    Melbourne
    MS-Off Ver
    2016
    Posts
    29

    Re: Exclude a specific value from drop down list

    Quote Originally Posted by JeteMc View Post
    The formula that produces the list from which the drop down is populated is itself populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The source for the data validation is: =OFFSET(N$2,0,0,SUMPRODUCT(--(N2:N10<>"")),1)
    Let us know if you have any questions.
    Thanks JetsMC so much - it worked perfectly.

    I didn't understood what the logic behind the formula is or what "AGGREGATE" does - maybe if you can explain a bit will be helpful for future

  19. #19
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,532

    Re: Exclude a specific value from drop down list

    In this case the AGGREGATE function provides an opportunity to utilize the SMALL (15) function ignoring calculation errors (6) and without having to activate the function by pressing the Ctrl + Shift + Enter keys (just press Enter).
    So the formula INDEXs the names in the name column finding the first name corresponding to the conditions, AUS and Full Time, then finds the second and so on. Once all the names have been found the IFERROR function prevents the INDEX function from displaying #NUM in the remaining rows that contain the formula.
    I would also suggest selecting cell N4 and running the Evaluate Formula feature (Formulas tab) and then select cell N5 and do the same to see the IFERROR function work.
    Let us know if you have any questions, however if the solution and explanation are satisfactory, please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ 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. Replies: 6
    Last Post: 02-16-2017, 05:08 PM
  2. [SOLVED] Exclude Values From List That Contain Specific Text
    By strother1990 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-29-2015, 11:50 AM
  3. [SOLVED] dynamic named range drop-down list to exclude N/A errors
    By tlacloche in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-07-2014, 11:51 AM
  4. Exclude blank gaps from Drop Down List + Auto complete
    By Adam329 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-15-2013, 09:49 AM
  5. Replies: 2
    Last Post: 08-02-2013, 08:04 AM
  6. [SOLVED] Dynamic Drop Down List - exclude blanks
    By Econocrat in forum Excel General
    Replies: 7
    Last Post: 08-24-2012, 02:10 PM
  7. Replies: 1
    Last Post: 08-25-2010, 09:45 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