Removing duplicates at conditional positions

billiboy

Board Regular
Joined
Jul 16, 2008
Messages
55
Hi!

I have two columns, A (animals) and B:

A--------------B
Elephant..........1
Monkey...........22
Horse..............3
Elephant..........4
Whale..............3
Horse..............4

I want another column, C, to display the animals without duplicates. In case of a duplicate, the animal should be displayed at the row with the highest B-value.

I.e. I want the column C to look like this:


A--------------B---------C
Elephant..........1............0
Monkey...........22...........Monkey
Horse..............3............0
Elephant..........4............Elephant
Whale..............3............Whale
Horse..............4............Horse

Do anybody have an idea how to do this?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Can you sort columns A and B? That might make this task easier.
 
Upvote 0
Put in C1
=IF(MAX(IF($A$1:$A$6=A1,$B$1:$B$6,0))=B1,A1,0)
Confirm with Ctrl+Shift+Enter

Assumes that A1 to A6 has the animals and B1 to B6 has the counts
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,186
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top