简体   繁体   English

如果值与来自两个单独列的条件匹配,则对一列中的单元格求和

[英]Sum cells in one column, if values match criteria from two separate columns

Please I need some help as I'm having trouble getting this to work.请我需要一些帮助,因为我无法让它工作。 Please see the image below.请看下图。 The result I want is the value in cell B21 for the entire table in the picture.我想要的结果是图片中整个表格的单元格 B21 中的值。 Cell A21 contains one piece of the criteria for the formula.单元格 A21 包含一个公式标准。 I need to sum the values in column H if the value in column F matches A21 and has the same value in column C or E. For example, the Proj# is the same for cells E2 and E3, and since F2 matches A21, the formula in theory will sum H2 and H3.如果 F 列中的值与 A21 匹配并且在 C 或 E 列中具有相同的值,我需要对 H 列中的值求和。例如,单元格 E2 和 E3 的 Proj# 相同,并且由于 F2 与 A21 匹配,因此理论上的公式将对 H2 和 H3 求和。 The result would be 9. I'd prefer a faster processing formula than an array or query结果将是 9。与数组或查询相比,我更喜欢更快的处理公式

电子表格的图像

Use Filter and Match:使用过滤器和匹配:

=sum(filter(H2:H16,isnumber(MATCH(E2:E16,filter(E2:E16,F2:F16=A21),0))+ISNUMBER(MATCH(C2:C16,filter(C2:C16,F2:F16=A21),0))))

在此处输入图像描述

shorter:更短:

=SUM(FILTER(H:H, REGEXMATCH(E:E&C:C, JOIN("|", FILTER(E:E&C:C, F:F=A21)))))

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 仅当两个单独的单元格匹配时才将值从一个单元格移动到另一个单元格 - Moving values from one cell to another only if two separate cells match Excel - 将列中的值分成两列 - Excel - Separate values from column into two columns 与多个条件中的一个或多个匹配的所有行的一列中的值的总和 - Sum values in one column of all rows which match one or more of multiple criteria 将唯一列与两个单独的列匹配 - Match a unique column to two separate columns 在谷歌表格中匹配索引两列条件和一行条件 - Match index two column criteria and one row criteria in google sheets 满足匹配行数据和动态日期列的标准的总和值 - Sum Values Meeting Criteria that Match Row Data and Dynamic Date Columns 电子表格 function 根据另一列的标准对一列中的所有值求和 - Spreadsheet function to sum all values in one column based on criteria from another column 如果单元格符合条件,则乘以和求和结果 - Multiply and Sum results if cells match criteria Google表格公式可计算一列中的值之和,该值与另一张表中的多列匹配 - Google Sheets formula to calculate sum of values in one column which match multiple columns in another sheet 是否可以使用两个标准单元格从第三列返回值? - Is it possible to use two cells of criteria to return a value from a third column?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM