It should result in a zero if it cannot find a match. You could always do this =IF(ISERROR(SUM(($A$2:$A$8=A13)*($B$2:$B$8=B13)*$G$2:$G$8)),0,SUM(($A$2:$A$8=A13)*($B$2:$B$8=B13)*$G$2:$G$8)).