You can use this formula : **=IFERROR( IF(D5=0, "",IF(D5>0, IF( SUMPRODUCT(($B$5:$B$44=B5)*($C$5:$C$44=C5),(D5<=$D$5:$D$44)/COUNTIF($D$5:$D$44,$D$5:$D$44))-INT(SUMPRODUCT(($B$5:$B$44=B5)*($C$5:$C$44=C5),(D5<=$D$5:$D$44)/COUNTIF($D$5:$D$44,$D$5:$D$44)))>=0.8,ROUND(SUMPRODUCT(($B$5:$B$44=B5)*($C$5:$C$44=C5),(D5<=$D$5:$D$44)/COUNTIF($D$5:$D$44,$D$5:$D$44)),0)+1,ROUNDUP(SUMPRODUCT(($B$5:$B$44=B5)*($C$5:$C$44=C5),(D5<=$D$5:$D$44)/COUNTIF($D$5:$D$44,$D$5:$D$44)),0)), "" ) ), "")**

To avoid a lengthy formula I used the previous formula.

If you are an advanced Excel user you can follow this formula too: **=IFERROR(IF(D5=0,"",LET(sumProd,SUMPRODUCT(($B$5:$B$44=B5)*($C$5:$C$44=C5),(D5<=$D$5:$D$44)/COUNTIF($D$5:$D$44,$D$5:$D$44)),IF(sumProd-INT(sumProd)>=0.8,ROUND(sumProd,0)+1,ROUNDUP(sumProd,0)))),"")**