Forum Discussion

brodskyfu's avatar
brodskyfu
Copper Contributor
Oct 09, 2024

Why SUM doesn't work out with dynamic array?

As above

  • brodskyfu You need to transpose first the range Q7:S7 then multiply and sum.

    =SUM(TRANSPOSE(Q7:S7)*R10#)

     SUMPRODUCT() will also work.

    =SUMPRODUCT(TOCOL(Q7:S7),R10#)

     

     

  • brodskyfu 

    There is also an old mathematical function that performs precisely the calculation you specified. 

     

    MMULT is a very fast function but, despite that, I would more often use the other formula

    = MMULT(rowArr, colArr#)
    
    = SUM(TOCOL(rowArr) * colArr#)

     

    • brodskyfu's avatar
      brodskyfu
      Copper Contributor
      Tks buddy! Ring a bell in memory~ 🙂
  • Harun24HR's avatar
    Harun24HR
    Bronze Contributor

    brodskyfu You need to transpose first the range Q7:S7 then multiply and sum.

    =SUM(TRANSPOSE(Q7:S7)*R10#)

     SUMPRODUCT() will also work.

    =SUMPRODUCT(TOCOL(Q7:S7),R10#)

     

     

    • brodskyfu's avatar
      brodskyfu
      Copper Contributor
      I checked the Transpose function, it just looks like that Transpose just rotates the range, but what is the reason behind the difference? I want understand it deeper. Tks~
    • brodskyfu's avatar
      brodskyfu
      Copper Contributor

      What is the difference in Excel mechanism behind?

Resources