Lookup multiple criteria problem

Stacy Rueda

Board Regular
Joined
Jun 23, 2016
Messages
87
Hi guys,

i need help on what formula should I use on below data. I have two files that consists of hundred of rows, wherein I want to lookup the price from file 1 to file 2 that will meet the same destination.

Example: For Part number AQ-123 (it has many destinations from file 1), but in file 2 i want to lookup the price only the required destination. Hope someone can help me, or if there is the same thread, kindly reply with the link. Appreciate your response. Thank you in advance.

[TABLE="width: 289"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]File 1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Part No.[/TD]
[TD]Destination[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]CN[/TD]
[TD] $ 13.00[/TD]
[/TR]
[TR]
[TD]AQ-909[/TD]
[TD]HK[/TD]
[TD] $ 76.00[/TD]
[/TR]
[TR]
[TD]AQ-987[/TD]
[TD]US[/TD]
[TD] $ 23.00[/TD]
[/TR]
[TR]
[TD]AQ-671[/TD]
[TD]US[/TD]
[TD] $ 34.00[/TD]
[/TR]
[TR]
[TD]AQ-234[/TD]
[TD]CN[/TD]
[TD] $ 131.00[/TD]
[/TR]
[TR]
[TD]AQ-298[/TD]
[TD]HK[/TD]
[TD] $ 421.00[/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]US[/TD]
[TD] $ 872.00[/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]HK[/TD]
[TD] $ 909.00[/TD]
[/TR]
[TR]
[TD]AQ-123 [/TD]
[TD]JP[/TD]
[TD] $ 16.00[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]File 2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Part No.[/TD]
[TD]Destination[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]AQ-298[/TD]
[TD]HK[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-234[/TD]
[TD]CN[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]CN[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]US[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-909[/TD]
[TD]HK[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-987[/TD]
[TD]US[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-671[/TD]
[TD]US[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi,

This is one way, change/adjust cell references/range, add sheet name, as needed:


Book1
ABC
1File 1
2
3Part No.DestinationPrice
4AQ-123CN$13.00
5AQ-909HK$76.00
6AQ-987US$23.00
7AQ-671US$34.00
8AQ-234CN$131.00
9AQ-298HK$421.00
10AQ-123US$872.00
11AQ-123HK$909.00
12AQ-123JP$16.00
13
14File 2
15
16Part No.DestinationPrice
17AQ-298HK$421.00
18AQ-234CN$131.00
19AQ-123CN$13.00
20AQ-123US$872.00
21AQ-909HK$76.00
22AQ-987US$23.00
23AQ-671US$34.00
Sheet583
Cell Formulas
RangeFormula
C17=SUMIFS(C$4:C$12,A$4:A$12,A17,B$4:B$12,B17)


Formula copied down.
 
Upvote 0
Hi @jtakw, Thank you very much for your reply. I tried your formula using the data above and it works, but during the actual file, the result is 0 in all rows. Is there an effect because I have different worksheet?
 
Upvote 0
Yes, as I mentioned above,

change/adjust cell references/range, add sheet name, as needed

You need to add the sheet name to the formula where it references where your lookup table resides, sample:

=SUMIFS(SheetName!C$4:C$12,SheetName!A$4:A$12,A17,SheetName!B$4:B$12,B17)
 
Upvote 0
Hi again @jtakw, I'm sorry but how it was happened that the formula above doesn't sum the price of PN? I'm sorry I thought it was ok already because what happened to my file is all price for AQ-123 sums up all the destination. Thank you in advance for the reply
 
Upvote 0
I'm not understanding your problem, can you explain what the issue is?
Are None of the Part No. Not summing?, Or some do, and some don't?

Describe what Is calculating correctly and what is Not.
Also, where does the data come from ( Part No., Destination, Price ), is it imported from another source, manually entered, or?
 
Upvote 0
Hi @jtakw, Sorry, but as per checking in my file, there are AQ-123 that has US repeatedly three times, then it doesn't need to sum all the three destination. I just need to get the price of US destination. Then per destination is fixed price, it doesn't change. Sorry I revised my first table. Please check AQ-123, the result should be $872 and not 2616 (sum). Thank you in advance.


For example

[TABLE="class: cms_table"]
<tbody>[TR]
[/TR]
[TR]
[TD]File 1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Part No.[/TD]
[TD]Destination[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]CN[/TD]
[TD]$ 13.00[/TD]
[/TR]
[TR]
[TD]AQ-909[/TD]
[TD]HK[/TD]
[TD]$ 76.00[/TD]
[/TR]
[TR]
[TD]AQ-987[/TD]
[TD]US[/TD]
[TD]$ 23.00[/TD]
[/TR]
[TR]
[TD]AQ-671[/TD]
[TD]US[/TD]
[TD]$ 34.00[/TD]
[/TR]
[TR]
[TD]AQ-234[/TD]
[TD]CN[/TD]
[TD]$ 131.00[/TD]
[/TR]
[TR]
[TD]AQ-298[/TD]
[TD]HK[/TD]
[TD]$ 421.00[/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]US[/TD]
[TD]$ 872.00[/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]HK[/TD]
[TD]$ 909.00[/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]US

[/TD]
[TD]$ 872.00
[/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]US[/TD]
[TD]$872.00



[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Part No.[/TD]
[TD]Destination[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]AQ-298[/TD]
[TD]HK[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-234[/TD]
[TD]CN[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]CN[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-123[/TD]
[TD]US[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-909[/TD]
[TD]HK[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-987[/TD]
[TD]US[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AQ-671[/TD]
[TD]US

[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Hi @jtakw, My file should not need to sum up the price, just looking at the price per destination. Is it possible If can use Index - Match

Looks like we posted at the same time.

Ok, so it seems you may have "duplicate" matching Part No. and Destinations, and you just want to lookup the Price, is that correct?

If so, would the duplicates be the same?, cause if we do an INDEX/MATCH, it'll return the First found only, or if they may be different, then what should happen?
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top