Determining duplicate values across multiple columns

J

John

I have two columns in my Excel file. From a DB perspective let's say
I want a two column primary key (columns A and B). I have code

=IF(COUNTIF(column_name,A1)>1,"Duplicate","")

which will show if a value is a duplicate in column A. If I want to
see if the combined values of column A and column B for a given row is
unique or duplicated, how would I redo the above code? So basically
if columns A and B were merged together into one column then repeat
the above compare. Thanks.

JR
 
L

Lukin

You could add a third column (C) which adds together (concatenates) th
values in Columns A and B, then search that column for duplicates.

To do this, in cell C1 type =A1&B1. Then change your formula to loo
in column C for duplicates
 
J

John

Thanks Guys. I figured out to create a new column and add the two
together after writing this, however still think it was messy having a
new column for that. Works however. Jeff, not sure if what you
propose actually compares each row in the two columns merged together,
however will give what you wrote a look. Thanks.

JR
 
J

John

Jeff,

Sweet!!!! That works great. My original code did not take into
account blank rows and always reported them as duplicate. This
doesn't seem to have that problem for some reason. Thanks for the
help.

JR
 
Top