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?
 

Some videos you may like

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

MrKowz

Well-known Member
Joined
Jun 30, 2008
Messages
6,653
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Can you sort columns A and B? That might make this task easier.
 

billiboy

Board Regular
Joined
Jul 16, 2008
Messages
55
The values in columns A and B are constantly changing, so I'm afraid they can't be sorted
 

dcamos

Board Regular
Joined
May 21, 2008
Messages
225
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,667
Messages
5,597,458
Members
414,145
Latest member
lonnie451

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
Top