[英]In SUMIFS function I am getting #VALUE error
For the top table above, I am using the following SUMIFS function: 对于上面的顶部表,我使用以下SUMIFS函数:
=SUMIFS($C$3:$G$23,$A$3:$A$23,"=Cinthol",$B$3:$B$23,"=Bangalore")
to try to get the results in the output format shown, based on two criteria {1. 尝试以显示的输出格式得到结果,基于两个标准{1。 Product and 2. City}.
产品和2.城市}。 But I am getting
#VALUE!
但我得到了
#VALUE!
error. 错误。
Am I doing something wrong? 难道我做错了什么?
You have two issues.
你有两个问题。
"each criteria_range argument must contain the same number of rows and columns as the sum_range argument"
and your criteria are
. =Cinthol
and
=Bangalore
“每个criteria_range参数必须包含与sum_range参数相同的行数和列数”,
并且您的条件是
。 =Cinthol
和
=Bangalore
This may directly be addressed quite easily by repeating the SUMIFS function for each of ColumnsC:G individually (and you might then sum the results). 通过单独为每个ColumnsC:G重复SUMIFS函数,可以非常容易地解决这个问题(然后您可以对结果求和)。
An alternative would be to add each row up in your data set and apply a PivotTable. 另一种方法是在数据集中添加每一行并应用数据透视表。
If you use SUMPRODUCT
you can get the required result without adding any columns, eg 如果您使用
SUMPRODUCT
您可以在不添加任何列的情况下获得所需的结果,例如
=SUMPRODUCT($C$3:$G$23*($A$3:$A$23="Cinthol")*($B$3:$B$23="Bangalore"))
or with cell references to copy down a table 或者使用单元格引用来复制表格
=SUMPRODUCT($C$3:$G$23*($A$3:$A$23=J2)*($B$3:$B$23=K2))
That assumes that there are no text values (or "formula blanks" like "") in the range C3:G23. 这假设在C3:G23范围内没有文本值(或“公式空白”,如“”)。 If there are then you can still make it work like this:
如果有,那么你仍然可以让它像这样工作:
=SUMPRODUCT($C$3:$G$23,ISNUMBER($C$3:$G$23)*($A$3:$A$23=J2)*($B$3:$B$23=K2))
There is a solution: 有一个解决方案:
First sum_range must be a column so instead of 第一个sum_range必须是一列而不是
=SUMIFS($C$3:$**G**$23,$A$3:$A$23,"=Cinthol",$B$3:$B$23,"=Bangalore")
it should be 它应该是
=SUMIFS($C$3:$**C**$23,$A$3:$A$23,"=Cinthol",$B$3:$B$23,"=Bangalore")
to make it work. 使它工作。
If it's not enough you can use =SUM(SUMIFS(), SUMIFS())
如果还不够,可以使用
=SUM(SUMIFS(), SUMIFS())
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.