+ Reply to Thread
Results 1 to 5 of 5

how to select distinct value from a column in excel automatically.

Hybrid View

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    Australia
    MS-Off Ver
    Office Enterprise 2010
    Posts
    1

    how to select distinct value from a column in excel automatically.

    Hi Everyone,

    This is my first post. I'm not so good with excel macro or functions.

    So i have one column with a list of name (Column A) and I want to get a distinct value of column A and produce Column B automatically. So that when I enter a value in column A, column B get updated automatically.

    A B
    ----------------------------
    1|Joe | Joe
    2|Joe | John
    3|John | Liz
    4|John |
    5|John |
    6|Liz |
    7|Liz |
    8|Liz |


    Please help
    thank you in advance.

  2. #2
    Forum Contributor
    Join Date
    11-26-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    159

    Re: how to select distinct value from a column in excel automatically.

    HI welcome to the board
    =INDEX($B$1:$B$10,MATCH(0,COUNTIF($C$1:C1,$B$1:$B$10),0))
    paste above formula in C2. Note: Be sure C1 shoudl be empty and hit CTRL+SHIFT+ENTER NOT JUST Enter and drag down

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

    Re: how to select distinct value from a column in excel automatically.

    I'd go with pivot tables..See attached
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Forum Contributor
    Join Date
    11-26-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    159

    Re: how to select distinct value from a column in excel automatically.

    Hi,

    there is another simple way.

    Go Data --> Adanced filter--> in List range, Select the range
    then -->Click on Copy to another location -->copy to "select a cell where you want output
    --> Check on Unique records Only--> then OK

    Thanks
    A

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: how to select distinct value from a column in excel automatically.

    This recorded macro will do that for you.

    See the example.

    Sub Delete_duplicates()
    
    'This recorded macro copies data to column M, removes Duplicates and paste the result in column B
    
        Columns("A:A").Select
        Selection.Copy
        Columns("M:M").Select
        ActiveSheet.Paste
        Application.CutCopyMode = False
        ActiveSheet.Range("$M$1:$M$500").RemoveDuplicates Columns:=1, Header:=xlNo
        Range("M1:M500").Select
        Selection.Copy
        Range("B1").Select
        ActiveSheet.Paste
        Application.CutCopyMode = False
        Columns("M:M").ClearContents
        Range("A1").Select
    End Sub
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

+ 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