=IFERROR(IF(SUMIFS(DataSalesQty,DataProduct,$B22,DataScheme,C$20)>1/LOOKUP(2,1/SUMIFS(ColF,ProductName,$B22,ToDates,">="&IF(DataProduct=$B22,DataDates),SchemeType,C$20,FromDates,"<="&IF(DataProduct=$B22,DataDates))),(1/LOOKUP(2,1/SUMIFS(SchemeValue,ProductName,$B22,ToDates,">="&IF(DataProduct=$B22,DataDates),SchemeType,C$20,FromDates,"<="&IF(DataProduct=$B22,DataDates))))/(1/LOOKUP(2,1/SUMIFS(ColF,ProductName,$B22,ToDates,">="&IF(DataProduct=$B22,DataDates),SchemeType,C$20,FromDates,"<="&IF(DataProduct=$B22,DataDates))))*SUMIFS(DataSalesQty,DataProduct,$B22,DataScheme,C$20),0),)