Perhaps:
L7:
=SUM(IF(FREQUENCY(IF(($E$7:$E$19=$J7)*($F$7:$F$19=$K7),MATCH($G$7:$G$19,$G$7:$G$19,0)),ROW($F$7:$F$19)-ROW($F$7)+1)>0,1))
committed with CTRL + SHIFT + ENTER
copy down as required - remember to reset the array if you alter the formula in anyway.
Bookmarks