Search code examples
google-apps-scriptgoogle-sheetsgoogle-sheets-formula

Google sheets: List with duplicate values. Get only one value from the duplicates with earliest date


I got a list with only duplicated values and an associated date. I want to get a result column with only one value out of the duplicates, but with the associated date. It's the earliest date I want.

Please look at example below (European dates):

enter image description here

I think I'm overthinking this as I have tried most formulas I know, but I can't figure it out.


Solution

  • Try

    =query(A:B,"select A,min(B) where A is not null group by A",1)
    

    or

    =query(A:B;"select A,min(B) where A is not null group by A";1)
    

    enter image description here