I have a 2-column data in Excel that looks like this: The first column is a value, and the Second column contains a corresponding word. However, I want to remove rows in this dataset such that, in the end, for each unique word in Column two, only one row is retained for which the value in the Column one is the largest for that word, removing even those rows having duplicates of the largest value for each unique word and leaving one row for each unique word.
2 cat
2 cat
1 cat
3 dog
2 dog
1 dog
2 milk
1 milk
2 juice
1 juice
The columns are ordered firstly by Column 2 (therefore the words are in alphabetical order: A-Z) and secondly by Column 1 (from largest to smallest, therefore the largest value is always the first value for each word).
I have been trying to do this using the advanced filtering
in Excel for Mac 2011, but I cannot seem to include the condition of removing all duplicate entries except for the entry that has the largest value in Column 1.
The desired output is as follows:
2 cat
3 dog
2 milk
2 juice
I have been searching for answers based on the query conditionally removing duplicates
, here and here, however each of the solutions provided seems to be based on a boolean condition (i.e. there is information or not), and not determining which value is the largest as the condition for which to remove the duplicate or not.
Any ideas on how to go about solving this?