具有单个公式的多列SUMS

问题描述 投票:1回答:1

我需要用单个公式将SUM多列(每列的总和,而不是总范围总和)。所以输出看起来像这样:


+-------+-------+------------+-----------+------------+
| 2019  | 2018  |    2017    |   2016    |    2015    |
+-------+-------+------------+-----------+------------+
| $0.00 | $0.00 | $4,341.00  | $0.00     | $5,281.00  |
| $0.00 | 0     | 0          | 0         | 0          |
| $0.00 | 0     | $10,805.00 | $2,865.00 | $8,295.00  |
| $0.00 | 0     | 0          | 0         | $233.00    |
+-------+-------+------------+-----------+------------+
| $0.00 | $0.00 | $15,146.00 | $2,865.00 | $13,809.00 |
+-------+-------+------------+-----------+------------+

我已经尝试了几种方法(SUMSUMIFSUMIFSMMULT),但似乎无法正确解决。我最接近的是来自我发现的网站的这个公式

=ArrayFormula(MMULT(B2:F5,(transpose(COLUMN(B1:F1)^0))))

我也希望避免需要0值,如下面的MMULT尝试所示。但是,如果那是使它工作所需的东西,那就这样吧。但是将首选空白值。我是在尝试不可能的事情,还是只是在寻找错误的方向?

My sheet

enter image description here

google-sheets sum transpose google-sheets-formula array-formulas
1个回答
1
投票
=ARRAYFORMULA(TRANSPOSE(MMULT(TRANSPOSE(IF(B2:5<>"", B2:5, 0)), ROW(B2:5)^0)))

0

© www.soinside.com 2019 - 2024. All rights reserved.