Discussion on:

Message 17 of 30
1 Vote
+ -
RE: How to find duplicates in Excel
I recently needed to make sure that I had three codes in a row of data with no duplicates, so I used the following formula (a1, a2, and a3 being the codes):

=IF(SUM(COUNTIF(C2:H2,"a1")=1, COUNTIF(C2:H2,"a2")=1, COUNTIF(C2:H2,"a3")=1 SUM(COUNTIF(C2:H2,"a1"), COUNTIF(C2:H2,"a2"), COUNTIF(C2:H2,"a3")), "err", SUM(COUNTIF(C2:H2,"a1"), COUNTIF(C2:H2,"a2"), COUNTIF(C2:H2,"a3")))

This gives me a count (up to 3) of unique codes and an "err" if a duplicate code is found.
It might not be very pretty or elegant, but it works.
Posted by rarg@...
9th Jun 2010