Search code examples
google-sheetsgoogle-sheets-formulavlookupgoogle-query-languageindex-match

Finding duplicates across range and summing it up


I have a list of agents who are working on OT, but the challenge is that they have 2 entries for OT per day, and when i need to work on this data with another sheet i have to sort out the data and remove duplicates manually in order not to cause issues with vlookup.

I need the end result to be like this:

if any agents works OT 2 times a day then sum it up and place in one raw with the date.

i have made helpers columns to show the duplicates but the i got stuck with the next steps

here is the sheet for the example:

https://docs.google.com/spreadsheets/d/1rdqylI9Rr4CxPIJcffEsqfoHx0loPVrqi2UJAQ30Sos/edit#gid=0


Solution

  • use:

    =QUERY(A2:C, "select A,B,sum(C) where C is not null group by A,B label sum(C)''")
    

    and vlookup from it...