+ Reply to Thread
Results 1 to 7 of 7

How to show values less than or equal to another value in drop down list, data validation

  1. #1
    Registered User
    Join Date
    10-31-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    4

    Unhappy How to show values less than or equal to another value in drop down list, data validation

    Hello,

    I have a problem where I want to show in a drop down list only the names that refer to values that are less than or equal to a separate value. I would be able to do this using data validation but I'm not sure how to go about it.

    I have included a spreadsheet with the number of marbles and four bags with different capacities. In the drop down list, I would like to only show the number of the bags that the marbles will fit in. For example, if there were 200 marbles then the drop down list would only show 2 and 3 as the capacity of bag 2 and 3 are larger than the number of marbles.

    Thank you for your help in advance!

    emily31
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How to show values less than or equal to another value in drop down list, data validat

    One way

    - Sort descending column C and D
    - Define a name as
    =Sheet1!D2:INDEX(Sheet1!D:D,MATCH(Sheet1!A2,Sheet1!D:D,-1))
    - In data validation use this under list option

    See attached
    Attached Files Attached Files
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to show values less than or equal to another value in drop down list, data validat

    or leave as it is use small= if to get the list
    =IFERROR(SMALL(IF($K$2:$K$5>=$A$2,$J$2:$J$5),ROWS($A$1:A1)),0) array entered
    then insert a name in this case i used
    =Sheet1!$L$2:INDEX(Sheet1!$L$2:$L$5,COUNTIF(Sheet1!$L$2:$L$5,"<>0")) and called it
    "myrange"
    then th validation becomes
    allow list
    =myrange
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    10-31-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: How to show values less than or equal to another value in drop down list, data validat

    Thank you Ace_XL for your help but I'm going to go with using martindwilson's method.


    Is there anyway I can change the bag numbers to a name? I'm trying to avoid having to sort the capacities.

    Thank you very much!

    emily31
    Attached Files Attached Files

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to show values less than or equal to another value in drop down list, data validat

    with a slight adjustment to formula in col L
    then maybe this
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-31-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: How to show values less than or equal to another value in drop down list, data validat

    Thank you so much for your help! I've managed to use this example to help me with another sheet but is there any way I can generalise the formulae so that I have the data validation/drop down list for 100 different rows, for example, a 100 different values for the number of marbles?

    Thank you,

    emily31
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-31-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: How to show values less than or equal to another value in drop down list, data validat

    Also, if two bags have the same capacity then only the name of the first bag found is shown twice as opposed two different names, for example, in the spreadsheet below, 'small bag' and 'another small bag' have the same capacity so 'small bag' is shown twice.
    Attached Files Attached Files

+ 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. [SOLVED] How to display list of values in cells after using data validation drop down?
    By Yadhvi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-03-2013, 12:15 PM
  2. Data Validation Drop Down Boxes (List) - Values Keep Duplicating
    By CJoQ in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-05-2012, 05:07 AM
  3. Replies: 6
    Last Post: 06-07-2012, 02:28 PM
  4. Replies: 4
    Last Post: 06-07-2012, 10:04 AM
  5. Replies: 2
    Last Post: 11-17-2005, 04:15 PM

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