Google Sheets – Using SUMPRODUCT Inside ArrayFormula

formulasgoogle sheetsgoogle-sheets-arrayformula

I have a fixed vector, say $A$1:$E$1

I also have a vector per row, say A2:E2, A3:E3, A4:E4…

Now I want output in Column F as

F2 = sumproduct(A1:E1,A2:E2)
F3 = sumproduct(A1:E1,A3:E3)
F4 = sumproduct(A1:E1,A4:E4)
...

Now I want to put these into one array formula, but I don't know how to do it. For example

F2 = Arrayformula(sumproduct($A$1:$E$1,A2:A:E2:E))

Meaning multiply A1-E1 vector with A2:E2, then A3:E3 and so on.

How do I do this?

Best Answer

=ARRAYFORMULA(IF(LEN(A2:A&B2:B&C2:C&D2:D&E2:E), 
 MMULT(A1:E1*A2:E,TRANSPOSE(COLUMN(A1:E1)^0)), ))

0