teggr234
teggr234

Reputation: 11

Remove duplicates only if both columns are the same - excel

I would like to remove rows with duplicates only if two columns are the same:

A B C.

—————————.

AA 11 L.

AA 12 l.

BB 12 L.

AA 11 C.

Basically, I want to check if both, A and B are the same, if they are, remove duplicates. So output is:

A B C.

—————————.

AA 11 L.

AA 12 L.

BB 12 L.

Upvotes: 0

Views: 187

Answers (2)

basic
basic

Reputation: 11968

It is standard behavior of Remove duplicates function. Just uncheck cols what you not need to compare.

enter image description here

Upvotes: 1

Let's say the data is like this:

enter image description here

My formula at D2 is =COUNTIFS($A$2:A2;A2;$B$2:B2;B2) and drag down.

Later on, you can filter in that column for any value higher than 1 (a 2 means a second coincidence, a 3 a third coincidence, and so on) and delete all those rows)

Hope this helps

IMPORTANT: Please, note the sorting here is important, because the formula starts counting from first row of data, so if you change the order, what was the first coincidence could be now the second one, and then be deleted. Be aware of that.

Upvotes: 0

Related Questions