I am working on excel tables that have duplicates. I have to eliminate the duplicates from loc 3 and 4 (Column 4 and 5) based on earliest start date and latest end date. Duplicates from loc 1 and 2 (Column 2 and 3) SHOULD NOT be removed. For example Tylenol and Pepcid in the following: Only duplicates with a Yes in Loc 3 and 4 must be removed with earliest start date and latest end date (see desired output). I have a lot of complicated tables to do this. Does anyone have a suggestions?