+ Reply to Thread
Results 1 to 9 of 9

Make Dropdown list without repeated value

Hybrid View

  1. #1
    Forum Contributor BlastRanger's Avatar
    Join Date
    09-02-2010
    Location
    Indonesia
    MS-Off Ver
    2003, 2007, 2010
    Posts
    238

    Make Dropdown list without repeated value

    Hi, refer to my attachment.
    How to make a dropdown list from a list of table that have repeated value which the repeated value should not seen more than once.

    Thank you for your time
    Attached Files Attached Files
    Last edited by BlastRanger; 11-08-2010 at 06:23 AM.
    Please give a Reputation as a gift for a thanks.
    By clicking the second icon at the top right corner of a user post or reply

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Make Dropdown list without repeated value

    You would need to build a separate list of unique sorted items and use that.

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

    Re: Make Dropdown list without repeated value

    Extending Bob's point, using your sample - insert a blank column between B & C (so Drop Down appears in Col D), then:

    B1:
    =IF(COUNTIF($A$1:$A1,$A1)>1,"",1+COUNTIF($A$1:$A$16,"<"&$A1))
    copied to B16
    
    C1:
    =IF(ROWS(C$1:C1)>COUNT($B$1:$B$16),NA(),INDEX($A$1:$A$16,MATCH(SMALL($B$1:$B$16,ROWS(C$2:C2)),$B$1:$B$16,0)))
    copied to C16
    Then, Data Validation Source:

    =OFFSET($C$1,0,0,COUNT($B$1:$B$16),1)

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Make Dropdown list without repeated value

    Hello,

    you could use Advanced Filter to filter out unique values and then sort them.

    Or you could use a helper column in column B and create a unique list in Column C.

    see attached.
    Attached Files Attached Files

  5. #5
    Forum Contributor BlastRanger's Avatar
    Join Date
    09-02-2010
    Location
    Indonesia
    MS-Off Ver
    2003, 2007, 2010
    Posts
    238

    Re: Make Dropdown list without repeated value

    Got the point.
    I must not sort the table. There DO formula work perfectly.
    Thank you everyone

  6. #6
    Forum Contributor BlastRanger's Avatar
    Join Date
    09-02-2010
    Location
    Indonesia
    MS-Off Ver
    2003, 2007, 2010
    Posts
    238

    Re: Make Dropdown list without repeated value

    Why COUNTIF($A$1:$A$16,"<"&$A2) will have answer as the "<" will only work on number not character? see my attachment
    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: Make Dropdown list without repeated value

    Regards your question in the sample file...

    The answer is 10 because there are 10 text strings in A1:A16 that precede "B2" in alphabet terms, namely:

    A1 * 2
    A2 * 2
    A3 * 2
    A4 * 2
    B1 * 2
    A precedes B and subsequently in terms of B1/B2 1 precedes 2

  8. #8
    Forum Contributor BlastRanger's Avatar
    Join Date
    09-02-2010
    Location
    Indonesia
    MS-Off Ver
    2003, 2007, 2010
    Posts
    238

    Re: Make Dropdown list without repeated value

    So that mean excel can calculate "<" in alphabet not only in number.
    I never know that before. Sigh..

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

    Re: Make Dropdown list without repeated value

    Yes.

    When discussing COUNTIF & Data Types it's worth remembering that COUNTIF will always interpret a numeric criteria as a number even if comparing to text strings

    To explain by means of example, create a new sheet:

    =ROW()&""
    copied down
    Then assume that (bizarrely) you wanted to COUNT how many of your numeric strings were less "<5" in alphabet terms - ie 5 ("1","2","3","4","10") a COUNTIF would not work given:

    =COUNTIF(A1:A10,"<"&"2")
    will return 0 as the criteria is seen as <2 and there are no numbers in the range.
    (you would use other functions for this - like SUMPRODUCT)

    The above is not relevant here but is one of the little COUNTIF nuances to be aware of
    Last edited by DonkeyOte; 11-08-2010 at 07:12 AM. Reason: trying to improve the example (failing...)

+ 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