This was my final code by the way if anyone was wondering

=COUNTIFS($A$1:$A1;$A2;$B$1:$B1;$B2;$E$1:$E1;"No")>0