Please help me with Sorting, Comparing and Deleting Rows

I have attached a sample of the file i work on. Actual worksheet contains more than 20,000 rows
It will be sorted by the message ID and then Names.

First deletion stage: Then we can delete all rows with which has unique or only one message ID in the entire worksheet.

Still sorted on message ID we go a step further to sort by names ( i.e within the message IDs sorted rows).

Second deletion stage: If two or more rows of the same Message ID have different names we have to delete those rows and leave the rows with the same names within each message ID.

Third deletion Stage: Now with the rows left if for the same message id which now has different names have the same duties the have to be deleted.

I would be very grateful if you can help me. Thanks

AttachmentSize
Data.xlsx103.6 KB
Almir's picture

Please help me with Sorting, Comparing and Deleting Rows

Kwesi,
- There are two worksheets, which one are you talking about?
- There is no Message ID, but Message Code, is that same?
- There is no Name, but Responsible Agent, is that same?
- Second deletion is unclear

In general, what do you want to accomplish? Do not mention how to do it, just tell us what do you want in final?