[英]How can I only count cells if a different cell is a specific value?
I have a range of cells that have different numbers. 我有一系列不同数量的细胞。 Each cell has another cell next to it which can contain OPEN or CLOSED.
每个单元格旁边都有另一个单元格,可以包含OPEN或CLOSED。 I only want to SUM the cells if their status cell says OPEN.
如果他们的状态单元格显示为OPEN,我只想对单元格求和。
Here's an example of what the number and status looks like 以下是数字和状态的示例
Adjust for your own columns and ranges: 根据您自己的列和范围进行调整:
=SUMPRODUCT(--(B2:B10="OPEN")*(A2:A10)) = SUMPRODUCT( - (B2:B10 = “OPEN”)*(A2:A10))
You could also use SUMIF() or SUMIFS(). 您还可以使用SUMIF()或SUMIFS()。
SUMIF
通常优选用于与条件求和
=SUMIF(B:B,"Open",A:A)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.