+ Reply to Thread
Results 1 to 10 of 10

count duplicate data in column

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-10-2010
    Location
    europe
    MS-Off Ver
    Excel 2007
    Posts
    149

    Question count duplicate data in column

    My goal is to return the unique counting
    How to count the number of occurrences of data that is duplicated in the column, but so to a group of duplicates has its unique sequential number.

    There is 4 case,
    Case1/Case3 is sorted text/values
    Case2/Case4 is unsorted text/values

    please you see example attach file
    Attached Files Attached Files
    Last edited by Dumy; 07-25-2015 at 02:23 AM. Reason: edit topic title

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: count duplicate - return unique count numbers

    This formula works for all 4 of your examples

    =SUM(IF(FREQUENCY(MATCH(B2:B10,B2:B12,0),MATCH(B2:B12,B2:B12,0))>0,1))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    09-10-2010
    Location
    europe
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: count duplicate - return unique count numbers

    ChemistB, Thanks for answer

    Maybe I misspelled topic title?
    I'm sorry but this is not correct the answer for me, or I do not understand something.
    This formula returns the number 4 or Unique counting numbers. I need a count for each unique data the same number

    Case1

    Count - Name Sorted
    1 A
    1 A
    2 B
    2 B
    2 B
    3 C
    3 C
    4 D
    4 D
    4 D
    4 D

    Case2

    Count - Name UNSORTED
    1 B
    2 A
    1 B
    1 B
    1 B
    2 A
    2 A
    3 D
    4 C
    4 C
    3 D


    Please see the attachment again
    I am, for each identified case enrolled the desired results

    If possible without VBA?

    regards
    Last edited by Dumy; 07-24-2015 at 04:53 PM.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: count duplicate data in column

    The first part of your problem: Values in A2:A12 enter in B2 and fill down:

    Formula: copy to clipboard
    =IF(A2<>A1,MAX($B$1:B1)+1,B1)


    A
    B
    2
    A
    1
    3
    A
    1
    4
    B
    2
    5
    B
    2
    6
    B
    2
    7
    C
    3
    8
    C
    3
    9
    D
    4
    10
    D
    4
    11
    D
    4
    12
    D
    4
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,888

    Re: count duplicate data in column

    Here is an array formula (meaning that it needs to be entered with Crtl + Shift + Enter) that will do what you want:
    =IF(OR(B$2:B2=B3),VLOOKUP(B3,B$2:C2,2,FALSE),C2+1)
    It needs to be noted that either the first value in the column will always be manually entered as 1 (as I did in columns J and M), or you put an empty row of cells under the column headers and use the formula throughout (as I did in columns C and F).
    After entering (as described) the formula, drag (copy) the formula down as far as needed. In the attached file the columns with the heading "Formula count" contain the values produced by the formula, which are identical to the ones provided originally.

    Copy of countduplicate.xlsx

    Hope this helps.

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: count duplicate data in column

    This formula will solve both of the problems that you gave in msg# 3
    If the data is in A2 to A12 and C2 to C12
    Enter this in B2 and fill down:
    Formula: copy to clipboard
    =IF(COUNTIF(A$2:A2,A2)=1,MAX(B$1:B1)+1,INDEX(B$1:B1,MATCH(A2,A$1:A1,0)))


    Enter this in C2 and fill down (same formula as above with references changed to suit new column)
    Formula: copy to clipboard
    =IF(COUNTIF($C$2:C2,C2)=1,MAX($D$1:D1)+1,INDEX($D$1:D1,MATCH(C2,$C$1:C1,0)))


    A
    B
    C
    D
    2
    a
    1
    b
    1
    3
    a
    1
    a
    2
    4
    b
    2
    b
    1
    5
    b
    2
    b
    1
    6
    b
    2
    b
    1
    7
    c
    3
    a
    2
    8
    c
    3
    a
    2
    9
    d
    4
    d
    3
    10
    d
    4
    c
    4
    11
    d
    4
    c
    4
    12
    d
    4
    d
    3

  7. #7
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: count duplicate data in column

    Pls find the file attach, for SORTED values Im borrow from newdoverman.....

    thanks
    Attached Files Attached Files

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,939

    Re: count duplicate data in column

    deleted deleted
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  9. #9
    Forum Contributor
    Join Date
    09-10-2010
    Location
    europe
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: count duplicate data in column

    Thank you very much guys
    All formulas are doing great, but I was the most appropriate single formula of @newdoverman which works on all four cases
    It's great that other formulas can be used for some cases

    I respect everyone
    (problem solved)

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: count duplicate data in column

    Thank you for the feedback.

+ 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] Count then Delete Duplicate Values and put count next to now unique value
    By flipjarg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-12-2014, 04:22 PM
  2. [SOLVED] ListBox of Unique values to also display Duplicate(Count)
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-26-2013, 04:49 PM
  3. Replies: 0
    Last Post: 03-22-2012, 08:44 PM
  4. Sort and count unique numbers
    By Kcarte in forum Excel General
    Replies: 5
    Last Post: 02-02-2012, 12:57 PM
  5. Count duplicate numbers
    By sans in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-03-2011, 05:50 PM
  6. Count unique numbers for execs
    By DanielJW in forum Excel General
    Replies: 2
    Last Post: 11-29-2005, 06:50 AM
  7. Replies: 3
    Last Post: 03-08-2005, 03:06 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