Forum Discussion

vmarshall1070's avatar
vmarshall1070
Copper Contributor
May 04, 2023

How to Remove Duplicates While Keeping Oldest Observation

Hi all. I am working with cross-sectional time series data and need to remove duplicate observations while keeping the oldest one. I was looking toward using the UNIQUE function but am unsure how to confidently do so. Each line item has a unique identifier (call it "id") and relevant date (call it "date") that the observation was recorded. How could I best go about doing this? Thanks!

1 Reply

  • Detlef_Lewin's avatar
    Detlef_Lewin
    Silver Contributor

    vmarshall1070 

     

    Enter this formula in a new column.

    =MINIFS([Date],[Line Item],[@[Line Item]])=[@Date]

     Filter the column on FALSE, select the rows and remove them.

     

Resources