简体   繁体   English

Excel-如果列中的单元格包含某个值,如何添加相邻单元格的值?

[英]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.

相关问题 将值添加到一系列单元格中,这些单元格的相邻单元格包含相同的值 - Add the values in a range of cells, whose adjacent cells contain same value 擅长:在列中查找值,其中单元格包含多个用逗号分隔的值,并从相邻列返回值 - excel: Find value in column where cells contain multiple values separated by commas and return value from an adjacent column 使用相邻单元格的值填充一列单元格(Excel VBA) - Populating a Column of Cells with Values from Adjacent Cells (Excel VBA) 如何在Excel列中为备用单元格添加值? - How to add values for alternative cells in Excel column? 如何在Excel中将值插入相邻单元格 - How to insert values to adjacent cells in Excel 如何在Excel中计算非相邻的空白单元格? - How can I count non adjacent blank cells in excel? Excel:如何组合包含特定文本的单元格? - Excel: How to combine cells that contain certain text? 如何在Excel中连续计数单元格,但仅对相邻单元格计数一次 - How can I count cells in a row but only count adjacent cells once in Excel 如何检索 excel 中可能不相邻的特定条件的单元格或行? - How to retrieve cells or rows with certain condition that may not be adjacent in excel? excel VBA:如何跳过两个包含值的单元格之间的空白单元格? - excel VBA : how to skip blank cells between 2 cells that contain values?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM