-
-
liumh 初学数据Lv2
发表于2021-1-26 14:40
悬赏10
已解决
楼主
我想在合计部分只计算当A4="010000"和"020000"时的B4的合计值,应该如何写合计公式? 我直接写SUM(IF((A4="010000")|(A4="020000"),B4,0)),可是运行后只计算出了"010000"的值,漏掉了"020000"的值。

最佳答案
本帖最后由 xxxl 于 2021-1-26 16:27 编辑
可以试试用数组对象的方法做,这是举得两个例子
https://bbs.esensoft.com/thread-136748-1-1.html
https://bbs.esensoft.com/thread-136596-1-1.html
比如我需要取'A'和'B'的合计值
=GRID1.A1$.select(@.value='A'|@.value='B').select(true,@.rightcell.value).sum()
A和B对应的是
农林牧渔业,采矿业
可以试试用数组对象的方法做,这是举得两个例子
https://bbs.esensoft.com/thread-136748-1-1.html
https://bbs.esensoft.com/thread-136596-1-1.html
比如我需要取'A'和'B'的合计值

A和B对应的是
农林牧渔业,采矿业

7个回答
本帖最后由 xxxl 于 2021-1-26 16:27 编辑
可以试试用数组对象的方法做,这是举得两个例子
https://bbs.esensoft.com/thread-136748-1-1.html
https://bbs.esensoft.com/thread-136596-1-1.html
比如我需要取'A'和'B'的合计值

A和B对应的是
农林牧渔业,采矿业

xxxl 发表于 2021-1-26 15:32
可以试试用数组对象的方法做,这是举得两个例子
https://bbs.esensoft.com/thread-136748-1-1.html
https: ...
明天试试这个方法