Hello, I am mathematician and have a good statistical finiancial skills on excel. Now i work in a bank as market risk manager, lets see your task and send me your task description. =IF(B7>0,0,IF(B7=0,AVERAGEIFS(R8:R17,P8:P17,"S"),"-")) it is the formula you looking for