[英]Excel - If cells in a column contain a certain value, how can I add the values of the adjacent cells?
Consider this spreadsheet: 考虑以下电子表格:
For all the cells in column A that contain the value "Y", how would I add the adjacent cells in column B together? 对于A列中所有包含“ Y”值的单元格,如何将B列中的相邻单元格加在一起?
This is what I've tried so far to no avail, assuming COLUMN__A and COLUMN__B are defined names of cells in those columns: 到目前为止,这是我一直没有尝试过的方法,假设COLUMN__A和COLUMN__B是这些列中定义的单元格名称:
=IF(ISNUMBER(SEARCH("Y",COLUMN__A)),SUM(COLUMN__B),0) = IF(ISNUMBER(SEARCH( “Y”,COLUMN__A)),SUM(COLUMN__B),0)
Try this one: 试试这个:
=SUMIF(A1:A100,"*Y*",B1:B100)
or 要么
=SUMPRODUCT(ISNUMBER(SEARCH("Y",A1:A100))*(B1:B100))
both case insensitive. 两者都不区分大小写。
Case sensitive formula is: 区分大小写的公式是:
=SUMPRODUCT(ISNUMBER(FIND("Y",A1:A100))*(B1:B100))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.