How to use array formula to return an array of sums in Excel

前端 未结 2 1419
难免孤独
难免孤独 2020-12-18 08:08

eg, we have

 1  2  4
 3  4  5
 4  5  5
 2  4  5

I would like a array formula that returns an ARRAY = {7,12,14,11} Note it is not text, it i

相关标签:
2条回答
  • 2020-12-18 08:10

    I think this evaluates to the required array and could be extended to larger ranges:

    =MMULT(A1:C4,TRANSPOSE(COLUMN(A1:C4)^0))

    0 讨论(0)
  • 2020-12-18 08:27

    When your matrix starts at A1 you can use:

    =VERKETTEN("{";SUMME(A1:C1); ",";SUMME(A2:C2);",";SUMME(A3:C3);",";SUMME(A4:C4);"}")
    

    This is of course for the german version. But "SUMME" should be SUM and "VERKETTEN" should be CONCATENATE. I'm sure you will find it in the help.

    then it will be:

    =CONCATENATE("{";SUM(A1:C1); ",";SUM(A2:C2);",";SUM(A3:C3);",";SUM(A4:C4);"}")
    

    Even shorter:

    ="{"&SUM(A1:C1)&","&SUM(A2:C2)&","&SUM(A3:C3)&","&SUM(A4:C4)&"}"
    

    For more you might need to use scripts that can handle loops etc.

    0 讨论(0)
提交回复
热议问题