=SUMPRODUCT(A2:A17,B2:B17,C2:C17)/SUMPRODUCT(A2:A17,C2:C17)
Thanks Jason, adding an extra column will not really help me here as the picture I sent was only a small part of a bigger file (as below). Excluding and including will depend on the cell I take as a reference and it will not be always the same whether I exclude or not. Any solutions coming to your mind without adding an extra column?You could use an extra column as a control by entering 1 (include) or 0 (exclude) in C2:C17, then change your formula to
Excel Formula:=SUMPRODUCT(A2:A17,B2:B17,C2:C17)/SUMPRODUCT(A2:A17,C2:C17)
=SUMPRODUCT(A2:A17,B2:B17,--(A2:A17<>A4))/SUMPRODUCT(A2:A17,--(A2:A17<>A4))