Search code examples
if-statementgoogle-sheetssumgoogle-sheets-formulaarray-formulas

Suming multiple cells that may not be number


I am struggling with this for a while and would like to receive your help. What I am trying to do is to sum the values of D column multiplied by value of E column, but not just sum elements of D and then multiply by sum of elements of E but first, multiply elements of each row, so for ex D2 * E2, D3 * E3 etc and then sum up result of multiplication of from each row. I tried to achieve this with arrayFormula and sum, but the problem is that in both column there may appear not a number, but character 'X', so the solution I created will not work. I was trying to use sumif alongside with arrayformula but it is not working and have no idea what to try to change to make this work. The formula I came up with is:

=ARRAYFORMULA(SUMif(D2:D24*E2:E24;"<>*X*"))

Example data:


Solution

  • try simple:

    =ARRAYFORMULA(SUM(IFERROR(A1:A*B1:B)))
    

    0