Forum Discussion

Anıl Adaş's avatar
Anıl Adaş
Brass Contributor
Apr 15, 2019
Solved

Remove Dublicates and Count (help pls)

I have a column and I simply need to count them with the help of an excel formula.   I add an example excel file to explain case easy. There are some numbers which I cannot remove but also cannot c...
  • SergeiBaklan's avatar
    SergeiBaklan
    Apr 15, 2019

    Anıl Adaş , if calculate how many values have duplicates, that's

    =SUMPRODUCT((A2:INDEX(A:A,COUNTA(A:A))<>"")/COUNTIF(A2:INDEX(A:A,COUNTA(A:A)),A2:INDEX(A:A,COUNTA(A:A))&"")-
    (COUNTIF(A2:INDEX(A:A,COUNTA(A:A)),A2:INDEX(A:A,COUNTA(A:A))&"")=1))

    That means if, for example, value ABC is repeated 4 times and other have no duplicates, formula returns 1 since that's only one value has duplicates.

     

    In your case it could be simplified to

    =SUMPRODUCT(1/COUNTIF(A2:INDEX(A:A,COUNTA(A:A)),A2:INDEX(A:A,COUNTA(A:A)))-(COUNTIF(A2:INDEX(A:A,COUNTA(A:A)),A2:INDEX(A:A,COUNTA(A:A)))=1))

    assuming you have no blank cells within the range.

     

    If you have ABC repeated 4 times and one XYZ, when

    total = 5

    with duplicates = 1

    count ignoring duplicates = 2

Resources