简体   繁体   English

Excel公式计算70

[英]Excel formula calculation 70

I am trying to come up with a formula that possibly uses the sumproduct function combined with another function. 我正在尝试提出一个可能使用sumproduct函数和另一个函数的公式。

Let me start by explaining what I have and what I want. 首先让我解释一下我所拥有的和我想要的。 If I have a list of 3 product numbers or more in a column, I would like excel to find the product numbers in 2 different possible columns and if they are listed there, I would like excel to multiply and sum. 如果我在一列中列出了3个或更多的产品编号,我希望excel在2个可能的不同列中找到产品编号,并且如果它们在此列出,我希望excel进行乘和求和。

I am currently using this formula: 我目前正在使用此公式:

=SUM(SUMPRODUCT(($B$27:$B$46='Lists for Estimates'!K2)*($E$27:$E$46*$A$27:$A$46))
+SUM(SUMPRODUCT(($F$27:$F$46='Lists for Estimates'!K2)*($I$27:$I$46*$A$27:$A$46)))
+SUM(SUMPRODUCT(($B$27:$B$46='Lists for Estimates'!K3)*($E$27:$E$46*$A$27:$A$46))
+SUM(SUMPRODUCT(($F$27:$F$46='Lists for Estimates'!K3)*($I$27:$I$46*$A$27:$A$46)))))

The issue with this is I have to continue to add to the formula if I add more to "Lists for Estimates." 问题是,如果我在“估算清单”中添加更多内容,则必须继续添加到公式中。 I would like to change the formula from 'List for Estimates'!K3 and K2 to search the entire column. 我想将公式从“估算列表”中更改为K3和K2,以搜索整列。

Thank you in advance! 先感谢您!

Create a new column on your data sheet that multiplies the A and E columns together (so the formula doesn't have to do it), and then use this formula: 在数据表上创建一个新列,该列将A和E列相乘(因此不必使用公式),然后使用以下公式:

=SUMPRODUCT(SUMIF($B$27:$B$46,'Lists for Estimates'!$K$2:$K$3,$F$27:$F$46))

Where column F contains the multiplied values. 其中F列包含相乘的值。 Adjust column F to suit your actual data. 调整F列以适合您的实际数据。 The multiplied value column can be hidden if preferred, or even put on a different worksheet. 如果愿意,可以隐藏“乘数值”列,甚至可以将其放在其他工作表上。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM