Search code examples
excelduplicates

How to show duplicate as 1 else 0 in Excel?


I have a column containing customer numbers(column A), there might be some duplicates in the column. What I wanted to do is, have column to the right of customer number(column B) and show 1 (if the customer number appears more than once) or 0 ( if it is unique).

How do I solve this problem?


Solution

  • Just write following formula in B1 and stretch it down:

    =IF(COUNTIF(A:A,A1)>1,1,0)