简体   繁体   中英

Need help in excel formula

在此处输入图片说明

1) I have two tables. 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

2) There are two types of prices in the 1st table . 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

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

5) Currently I am manually updating "Total Price" details in 2nd table for Wholesale price which is taking lot of time.

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 .

Based on your screen shot:

  • D is the column with the list of items
  • I5 is the cell with the item name for which you want to find the wholesale price
  • F is the column with the list of prices

If you enter the following formula in cell K5, it should find the lowest price for pencils

=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

try the sumifs function. 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. 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...

, 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.

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.

SUMIFS is probably the better way to go on this one, but as an alternative there is also 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. 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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