In this weeks blog post I will demonstrate how to omit duplicate records while only retaining the most recent occurrence of each unique record within a column. In the data set below we have a list of customer IDs along with dates on which each of those customers placed online orders within the year.
The goal is to only capture the most recent order per customer ID and delete all other remaining records. Four simple steps will help us achieve this.
STEP 1] Create a helper column and generate an ascending sequence of numbers starting from 1 as shown below.
STEP 2] Sort by “Order Date” (i.e. Column B) Descending.
STEP 3] Remove duplicates from the “Customer ID” column.
STEP 4] Sort by the helper column ascending.
Here is the final outcome depicting the most recent entry for each unique Customer ID.