+ Reply to Thread
Results 1 to 5 of 5

Auto selecting the unique values from a list

Hybrid View

  1. #1
    Registered User
    Join Date
    08-18-2011
    Location
    East Sussex, England
    MS-Off Ver
    Excel 2007
    Posts
    76

    Auto selecting the unique values from a list

    I know I can do this manually but I was wondering if there was a way to do this automatically.

    For example:

    1, 1, 2, 4, 3, 5, 5, 3, 2, 5


    should become....

    1, 2, 3, 4, 5

    Although in excel this would be in columns with each number in a separate cell.

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

    Re: Auto selecting the unique values from a list

    This formula will also cope with blank cells. Assumes data in A1 to A30 and this Array Formula in C2, copied down.

    =IFERROR(INDEX($A$2:$A$30,MATCH(0,COUNTIF($A$2:$A$30,"<"&$A$2:$A$30)-SUM(COUNTIF($A$2:$A$30,$C$1:C1)),0)),"")

    Array Formulae are a little different from ordinary formulas in that they MUST be 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 the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...
    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

  3. #3
    Registered User
    Join Date
    08-18-2011
    Location
    East Sussex, England
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Auto selecting the unique values from a list

    Hurrah! Thanks very much.

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

    Re: Auto selecting the unique values from a list

    You're welcome!!

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Auto selecting the unique values from a list

    If your data really is numbers...

    Data Range
    A
    B
    C
    1
    Header
    ------
    Header
    2
    1
    1
    3
    1
    2
    4
    2
    3
    5
    4
    4
    6
    3
    5
    7
    5
    8
    5
    9
    3
    10
    2
    11
    5


    This formula entered in C2:

    =MIN(A2:A11)

    This array formula** entered in C3:

    =IFERROR(1/(1/MIN(IF(A$2:A$11>C2,A$2:A$11))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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] Macro to Auto Sum & Auto Print Unique Values
    By mst3kr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2018, 03:17 PM
  2. Replies: 3
    Last Post: 04-27-2015, 12:16 PM
  3. 3 columns: None contain unique values, but I need a list of every unique set
    By mathematician in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-15-2012, 04:47 PM
  4. [SOLVED] selecting unique values
    By Navin Agrawal in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-02-2012, 04:11 PM
  5. Selecting unique occarences from a list
    By raala12 in forum Excel General
    Replies: 5
    Last Post: 04-15-2010, 06:10 PM
  6. Filter for unique values on an already auto-filtered list?
    By dylanemcgregor in forum Excel General
    Replies: 1
    Last Post: 01-11-2010, 07:25 PM
  7. Auto call a procedure by selecting from a dropdown list
    By Jay3 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-30-2008, 03:36 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