excelexcel-formulasumproduct

Using SUMPRODUCT involving a column which contains empty values coming from an IF(...; ...; "")


Let's say we have this Excel sheet:

In this last example, how to compute the sum of the products a_i * (b_i - 5), for each non-empty row, with SUMPRODUCT?

I also tried with N(...) without success.


Solution

  • If you did want to try and use N(), there is a trick to it. You have to put

    =SUMPRODUCT(A1:A100,N(+B1:B100)-5)
    

    Don't ask me why.