+ Reply to Thread
Results 1 to 10 of 10

Finding All Unique Values In One Column

  1. #1
    Registered User
    Join Date
    09-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Finding All Unique Values In One Column

    Hey guys,

    I have looked at a few forums and used a few formulas I found online however I cant find one that works. The problem sounds so simple in theory yet is incredibly hard for me to do. I have Column A in Excel with around 900k pieces of data. There are duplicates in Column A, I do not want to remove duplicates so only one version is left, I want to remove both occurrences of the duplicate so that in Column B I get all the data that is not anywhere in column A. I have used a few formulas I found online but I honestly could not get any of them to work. Would appreciate help in this as its really frustrating.

    Thanks

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Finding All Unique Values In One Column

    Try this one

    =IFERROR(INDEX($A$2:$A$14,MATCH(0,INDEX(COUNTIF($B$1:B1,$A$2:$A$14),,),)),"")

    A
    B
    1
    Unique
    2
    GP7336 GP7336
    3
    GP4230 GP4230
    4
    GABC42 GABC42
    5
    GATB10 GATB10
    6
    GAEA73 GAEA73
    7
    GP7336 GARB73
    8
    GABC42 GAOB73
    9
    GARB73 GARB60
    10
    GAOB73 GASB27
    11
    GARB60 GASW00
    12
    GASB27 GATR31
    13
    GASW00
    14
    GATR31
    15
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

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

    Re: Finding All Unique Values In One Column

    Not real clear.

    If this is your data what results do you expect?

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


    With 900K rows of data a formula solution will be slow to calculate.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    09-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Finding All Unique Values In One Column

    Quote Originally Posted by Tony Valko View Post
    Not real clear.

    If this is your data what results do you expect?

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


    With 900K rows of data a formula solution will be slow to calculate.
    Hey man, thanks for the reply. From your sample data I only want it to give me back the number 2 and number 4 since all others have a duplicate. @Alkey I am testing your formula now, thanks for putting it together. Will reply back here. Yeh these formulas do take a while to compute but I really need this data

  5. #5
    Registered User
    Join Date
    09-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Finding All Unique Values In One Column

    Quote Originally Posted by AlKey View Post
    Try this one

    =IFERROR(INDEX($A$2:$A$14,MATCH(0,INDEX(COUNTIF($B$1:B1,$A$2:$A$14),,),)),"")

    A
    B
    1
    Unique
    2
    GP7336 GP7336
    3
    GP4230 GP4230
    4
    GABC42 GABC42
    5
    GATB10 GATB10
    6
    GAEA73 GAEA73
    7
    GP7336 GARB73
    8
    GABC42 GAOB73
    9
    GARB73 GARB60
    10
    GAOB73 GASB27
    11
    GARB60 GASW00
    12
    GASB27 GATR31
    13
    GASW00
    14
    GATR31
    15
    Hey ALKey tried it now but it says cannot calculate the formula, there is a circular reference in the open workbook but the reference that cause it cannot be listed for you.

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Finding All Unique Values In One Column

    assuming your data starts from A1 and goes down till A900 in column B1
    copy paste below hold control and shift together and hit enter
    =IFERROR(INDEX($A$1:$A$900,SMALL(IF(COUNTIF($A$1:$A$900,$A$1:$A$900)=1,ROW($A$1:$A$900)-ROW($A$1)+1),ROW(A1))),"") and then drag down till you get empty cell
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

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

    Re: Finding All Unique Values In One Column

    Try this...

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


    This array formula** entered in C2:

    =IFERROR(INDEX(A:A,SMALL(IF(FREQUENCY(MATCH(A$2:A$11,A$2:A$11,0),ROW(A$2:A$11)-ROW(A$2)+1)=1,ROW(A$2:A$11)),ROWS(C$2:C2))),"")

    ** 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.

  8. #8
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Finding All Unique Values In One Column

    GO with post #7 calculation time will be much shorter in that !

  9. #9
    Registered User
    Join Date
    09-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Finding All Unique Values In One Column

    Thanks for this guys, I couldnt test if it works or not since my computer froze every time I tried but Im sure its correct

  10. #10
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Finding All Unique Values In One Column

    You could also try this non-array method, it'll calculate faster

    Assume data runs in A2 down
    In B2: =IF(A2="","",IF(COUNTIF(A:A,A2)>1,"",ROW()))
    Copy down to last row of data

    In C2: =IF(ROWS($1:1)>COUNT(B:B),"",INDEX(A:A,SMALL(B:B,ROWS($1:1))))
    Copy down just enough, ie until blanks are returned
    ---------------------------------
    Any good? Wave it, hit the little star at the bottom left of my responses

+ 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. Need help in finding sum acording to unique values in diff column
    By gokzee in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-22-2012, 05:52 AM
  2. Count Unique Values In One Column Basis Unique Values in Another Column
    By shez_raz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-07-2012, 01:55 AM
  3. Finding unique values in a column
    By Moondog in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-18-2010, 06:50 AM
  4. Finding Unique Values
    By davidimurray in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2007, 05:02 AM
  5. [SOLVED] Finding Unique Values in Column
    By Kirk P. in forum Excel General
    Replies: 3
    Last Post: 01-25-2005, 10:06 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