Search code examples
google-sheetsgoogle-sheets-formula

Google Sheets - Match two tabs with a constant - find another cell in matched row. Select those matches - remove the row that has the source constant


I have an example sheet for this:

https://docs.google.com/spreadsheets/d/1L0WzApx5KK_aFBwQIrRvMDCxQFJwU7zIVlBsOPw9E2o/edit#gid=653993578

First tab named "Source 1"

Column D has repeating names in it. In those repeating names only one has a value in column E.

On tab named "List Needed" I need to filter all the rows that have the same ID value in Column A but have matches in Column D. However, I need to EXCLUDE the row that has the matching value in Column E.

Tab named "Should look like this" Has what I would want the results to look like when I run this formula on "List Needed"

I am not sure if this is an array formula or a script or a really fancy lambda formula or if this is even possible!

Thank you for all your help.


Solution

  • Try this - I have used the data in column D of Source1 to fill in the missing ID's, then limited the output to those rows which have a match in List Needed but don't have an entry in column E of Source1:

    =ArrayFormula(let(IDNoBlank,filter(Source1!D:E,Source1!E:E<>""),
    IDFilled,iferror(vlookup(Source1!D:D,IDNoBlank,2,false),""),
    filter(Source1!A:E,isnumber(vlookup(IDFilled,'List Needed'!A:A,1,false)),Source1!E:E="")))
    

    enter image description here