+ Reply to Thread
Results 1 to 13 of 13

Unique value from a column

  1. #1
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    51

    Unique value from a column

    Hi, was wondering if it is possible to retrieve unique data from a whole column of data. The situation is that I will have a column of data with unknown number of records as it always changes after each use. In this column, there will be a number of unique datas each appearing a different number of times. How can I retrieve the value of each of unique data to work with. Just to add on, the number of unique data will be different each time. And each data might be mixed around. For example Mary appear in the first 2 cells followed by John in the next 3 cells and Jim in the next 1 cell. Following which Mary will appear again. Well to sum it up I'm trying to get unique data to work with which is all around the place and appearing a random number of times. Appreciate if anyone is able to help.
    Thank you

    P.S. The reason I'm trying to get the unique data is that this project is to write a batch file which moves files to a folder and each name represent a folder. But each of this folder requires a document which only needs to be there once. So I'm trying to get the unique data so I can get it to move the document into that folder.
    Last edited by hoongz; 06-04-2012 at 04:33 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Unique value from a column

    Hi

    With your Names, starting in A2, try this and copy down in B2.

    =IF(COUNTIF($A2:$A$100,A2)=1,A2,"")

    Is this, works for you?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,527

    Re: Unique value from a column

    Check out this link:

    http://www.get-digital-help.com/2009...om-one-column/

    It shows you exactly how to do that.

    Hope this helps.

    Pete

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Unique value from a column

    Hi hoongz,

    Two quick options->

    1) Data - Advanced Filter -> check "unique records only" and then you can copy the unique entries

    2) Select that column and create a pivot (alt + D + P) and in design of pivot, move data to row and that's it.. you can get the unique entries form the only column of pivot structure.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  5. #5
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Unique value from a column

    Hi guys. A very big thank you for your prompt response. I guess I should be adding the point that I already have a vb script running in the back doing other functions on a click of a button. This request is just a additional task I need to add in. What I'm trying to do is in the script, I have to get the unique value into a variable and do something to it before moving on to the next unique value. All without any additional effort after the user fill in the basic data like name column and file ids and clicking the button. Currently the file is able to write a batch file to move each of the file into each sub folder. A clearer picture would be as follows:
    Name(Main Folder)>Invoice(Sub Folder)>some supporting documents for that invoice.
    Now Im required to add a few documents into the main folder which accounts for all the invoices done in the month by the same person. Since my script writes the file based on the invoice number, the user name tends to appear multiple times. But it's not fesible to write a file to copy the same file over and over again into the same folder. Hence I'm seeking professional help in this forum to retrieve unique values under the name folder. Hope that makes my request clearer. Im sorry Im unable to show you the file I've done up so far as it contains confidential data.

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

    Re: Unique value from a column

    In this column, there will be a number of unique datas each appearing a different number of times
    doesn't that contradict itself?
    "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

  7. #7
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Unique value from a column

    Quote Originally Posted by martindwilson View Post
    doesn't that contradict itself?
    How does it contradict itself. It simply means that there are many different values each appearing different number of times throughout the whole column.

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

    Re: Unique value from a column

    you cant have something unique repeating itself, it is then not unique

  9. #9
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Unique value from a column

    Maybe our understanding of unique is different. My undestanding of unique is that it is a value that is different from any other possible value within the whole range that is different. But that doesn't mean it could only appear once. It's just unique from other possible different value.

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,166

    Re: Unique value from a column

    can you upload example workbook?

    I think you can use Pivot table, but it would be easier if we could see example.
    Never use Merged Cells in Excel

  11. #11
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Unique value from a column

    Is this what you are looking for?

    Create Unique Values from 1 column with IsInArray.xlsm

  12. #12
    Registered User
    Join Date
    09-20-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Unique value from a column

    I've attached a sample workbook. Basically it shows that there are many different lines from the same department. But I only need to get one of each. I've tried to use collection but it doesn't filter duplicate values. Appreciate if I could get help on this.
    Thank you
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Unique value from a column

    Have you checked my file?

+ 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