удалить F2: F и вставить в ячейку F2 :
=ARRAYFORMULA(IFNA(VLOOKUP(A2:A&E2:E, QUERY({Sheet2!A2:A&Sheet2!B2:B,
IF(Sheet2!G2:G="yes", 1, 0)},
"select Col1,sum(Col2)
where Col1 is not null
group by Col1
label sum(Col2)''"), 2, 0)=2))
если задания Sheet2 не всегда в парах, используйте:
=ARRAYFORMULA(IFNA(VLOOKUP(A2:A&E2:E, QUERY({Sheet2!A2:A&Sheet2!B2:B,
IF(Sheet2!G2:G="yes", 1, 0)},
"select Col1,sum(Col2)
where Col1 is not null
group by Col1
label sum(Col2)''"), 2, 0)=
IFNA(VLOOKUP(A2:A&E2:E, QUERY({Sheet2!A2:A&Sheet2!B2:B,
IF(Sheet2!G2:G="yes", 1, 0)},
"select Col1,count(Col2)
where Col1 is not null
group by Col1
label count(Col2)''"), 2, 0))))