简体   繁体   English

在SUMIFS函数中,我收到#VALUE错误

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

相关问题 在SUMIFS中获取#VALUE错误 - Getting #VALUE error in SUMIFS SUMIFS函数返回零值 - SUMIFS function returns Zero value 为什么在使用 ifs function 时 excel 中出现值错误? - Why am I getting a value error in excel while using the ifs function? 我收到编译错误,预计会识别 function 错误 - I am getting compile error expected identified function error 为什么我会得到“#NAME”? 我的自定义函数在 excel 中出错? - Why am I getting the “#NAME?” Error in excel for my custom function? 我没有使用 on error resume next 获得所需的值 - I am not getting the desired value using on error resume next 使用 sumifs 和间接 function 工作表的公式。 获得参考错误,尽管它与不同的列一起使用 - Formula using sumifs and indirect function for worksheets. Getting Reference error although Had it working with different columns 我不断收到“ mydate = Sheets(“ Summary”)。Cells(i,“ A”)。Value”的“运行时错误13”。 - I am constantly getting 'Run time error 13' with 'mydate = Sheets(“Summary”).Cells(i, “A”).Value' SUMIFS 函数返回与过滤和使用 SUBTOTAL 不同的值 - SUMIFS function returning different value than filtering and using SUBTOTAL 为什么在尝试使用 openpyxl python 读取单元格值时出现“权限被拒绝错误”? - Why am I getting a “Permission denied error” while trying to read a cell value using openpyxl python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM