![](/img/trans.png)
[英]Google Apps Script: Compare One Cell to Another, then Increment Cell Value
[英]Google Spreadsheet - Sum cell value if another cell contain one of N strings
如本Google Spreadsheet所示,仅当值行中具有从列表中选择的字符串之一时,我才希望从列中求和货币值列表。
| Tag | Value |
| : | : |
| Goo | 12$ | <= SUM value because I have Goo or Boo
| Dee | 3$ |
| Boo | 4$ | <= SUM value because I have Goo or Boo
| Yoo | 7$ |
| : | : |
| Result | 16$ |
我没有找到一种方法,那可能吗?
您可以将两个SUMIF()
函数加在一起。
=SUMIF(A:A,"Goo",B:B) + SUMIF(A:A,"Boo",B:B)
假设A:A
包含要匹配的单词,而B:B
包含要求和的值。
为了更具体地解决您的问题,您实际上必须修改范围,以免出现任何循环参考错误(因为该单元格与求和范围位于同一列中)
因此,例如,如果包含您的公式的单元格在第25行中,那么类似这样的方法应该起作用:
=SUMIF(A1:A24,"Goo",B1:B24) + SUMIF(A1:A24,"Boo",B1:B24)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.