Home > Software engineering >  Is there a formula to resolve duplicates in one column by looking at a second column?
Is there a formula to resolve duplicates in one column by looking at a second column?

Time:07-13

I have a google sheet with 2 columns, A (containing names) and B (containing dates). there are quite a few duplicates in A which I need resolved by looking at B and selecting the row with the soonest date. Ideally I need to extract the data to make a list on another sheet with no duplicates, being resolved by the above method. the issue is that there might be new rows added to the sheet, and I need the new rows checked against the existing data to confirm it has a sooner date compared to potential duplicates. how can I formulate this?

CodePudding user response:

There is probably a better way, but I just use the query function to put the results in a different sheet so I don't mess with the source data.

=QUERY()

Here is some examples on how it is used: https://support.google.com/docs/answer/3093343

As for the query itself, something like this should work. A being the first column (Name), and B being the second column (Date).

SELECT A, MAX(B) GROUP BY A
  • Related