简体   繁体   English

在Excel公式中需要帮助

[英]Need help in excel formula

在此处输入图片说明

1) I have two tables. 1)我有两个桌子。 1st table contains data for more then 20,000 rows and 2nd table I already have the following columns details ie Region, Item, Number and I just have to get the Total value of the product from the 1st table 第一张表包含超过20,000行的数据,第二张表我已经具有以下列详细信息,即Region,Item,Number,我只需要从第一张表中获得产品的总价值

2) There are two types of prices in the 1st table . 2)第一张表中有两种价格类型。 One is Retail Price and Another one is a Wholesale price 一个是零售价,另一个是批发价

3) In each of the regions Rep, Item and Numbers are same in most of the cases, but the Total price is different 3)在大多数情况下,每个区域的代表,项目和编号都相同,但总价不同

4) I am able to get the Total price details in 2nd table through vlookup formula (After concatinating the following columns ie Region, Item and Number from both the tables) wherever there is an account number for retail price 4)我可以通过vlookup公式在第二张表中获得总价格明细(在两个表中都添加了以下列,即Region,Item和Number之后),只要有零售价的帐号

5) Currently I am manually updating "Total Price" details in 2nd table for Wholesale price which is taking lot of time. 5)目前,我正在手动更新第二张表中的“总价”详细信息以获取批发价,这需要花费大量时间。

Is it possible to build a formula to get the wholesale price details in the 2nd table, since there are more then one account number, but the price is same 是否可以建立一个公式来获取第二个表中的批发价格明细,因为存在多个帐号,但是价格相同

If the wholesale price is the lowest price for the specific item, then you can find it with the formulas MIN and IF . 如果批发价是特定商品的最低价格,则可以使用公式MINIF进行查找。

Based on your screen shot: 根据屏幕截图:

  • D is the column with the list of items D是带有项目列表的列
  • I5 is the cell with the item name for which you want to find the wholesale price I5是您要查找其批发价格的项目名称的单元格
  • F is the column with the list of prices F是带有价格列表的列

If you enter the following formula in cell K5, it should find the lowest price for pencils 如果您在单元格K5中输入以下公式,它将找到铅笔的最低价格

=MIN(IF(D:D=I5,F:F))

On this link, there is an explanation if you want to use multiple criteria. 如果您要使用多个条件,则在此链接上有一个解释。 http://www.contextures.com/excelminmaxfunction.html http://www.contextures.com/excelminmaxfunction.html

try the sumifs function. 尝试sumifs函数。 It takes multiple arguments and criteria. 它需要多个参数和条件。 So it should look something like: 所以它应该看起来像:

cell value at j5 = sumifs(f3:f23, b3:b23, h5, d3:d23, i5....) you need to mark off which rows in your first table are wholesale selling. j5处的单元格值= sumifs(f3:f23,b3:b23,h5,d3:d23,i5 ....),您需要标记出第一张表中的哪些行是批发销售。 So it should be a column of some kind. 因此,它应该是某种形式的专栏。 Once you do that, let's say in column G, then you add onto the sumifs function... 完成后,在G列中说,然后添加到sumifs函数中...

, g3:g23, L5) ,g3:g23,L5)

What you're doing is summing up all of the values in column F where h5 (region) matches in b3:b23, i5 (item) match in d3:d23, and where L5 (retail type) match in a new column g2:g23. 您正在做的是汇总F列中的所有值,其中h5(区域)在b3:b23中匹配,i5(项目)在d3:d23中匹配,而L5(零售类型)在新g2列中匹配: g23。

This will find all of the values that match that criteria exactly. 这将找到与该条件完全匹配的所有值。 Vlookup is useful, but it's harder to scale IMO than the advanced if functions. Vlookup很有用,但是扩展IMO的难度要大于高级if函数。

SUMIFS is probably the better way to go on this one, but as an alternative there is also SUMPRODUCT. SUMIFS可能是进行此操作的更好方法,但也可以选择SUMPRODUCT。

=SUMPRODUCT(($H3=$B$3:$B$20004)*($I3=$D$3:$D$20004)*($J3=$E$3:$E$20004)*($F$3:$F$20004))

The * acts as an AND statement in a logical check, and each of the ($H3=$B$3:$B$20004) is a logical check. *在逻辑检查中充当AND语句,而每个($H3=$B$3:$B$20004)都是逻辑检查。 When the row is true it will evaluate to 1. When it is false it will evaluate to 0. in the end you wind up with a list of prices or 0s that get summed. 当该行为true时,它将求值为1。当为false时,它将求值为0。最后,您最终得到一个汇总的价格或0的列表。 The end result is the sum of everything that matches your criteria. 最终结果是符合您条件的所有内容的总和。

The danger of using this formula is that it can get labour intensive as it is performing array calculations without being an array formula. 使用此公式的危险在于,它在执行数组计算而不是数组公式时会占用大量劳动力。

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

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