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.

File 1
Part No.DestinationPrice
AQ-123CN $ 13.00
AQ-909HK $ 76.00
AQ-987US $ 23.00
AQ-671US $ 34.00
AQ-234CN $ 131.00
AQ-298HK $ 421.00
AQ-123US $ 872.00
AQ-123HK $ 909.00
AQ-123 JP $ 16.00
File 2
Part No.DestinationPrice
AQ-298HK
AQ-234CN
AQ-123CN
AQ-123US
AQ-909HK
AQ-987US
AQ-671US

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 
Looks like we posted at the same time again, give a 10 minutes, I'll post an updated formula for you ( making dinner ;) ).
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Yes sir, I just really want to lookup the price.

Yes, the duplicates is just the same. even first found only, it will don't care the second and the next rows, because each PN has unique price per destination.
 
Upvote 0
Yes, the duplicates is just the same. even first found only, it will don't care the second and the next rows, because each PN has unique price per destination.
With duplicates all the same, please change the SUMIFS to AVERAGEIFS
 
Upvote 0
Ok, updated formula, see how this works for you.

C19 INDEX/MATCH Array formula to be confirmed by CSE (Control, Shift, Enter), instructions below.
D19 AVERAGEIFS formula normally entered.

Don't forget to change/adjust cell references/range, and add sheet name, as needed, formula copied down.


Book1
ABCD
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-123US$872.00
13AQ-123US$872.00
14
15
16
17
18Part No.DestinationPrice
19AQ-298HK$421.00$421.00
20AQ-234CN$131.00$131.00
21AQ-123CN$13.00$13.00
22AQ-123US$872.00$872.00
23AQ-909HK$76.00$76.00
24AQ-987US$23.00$23.00
25AQ-671US$34.00$34.00
Sheet586
Cell Formulas
RangeFormula
D19=AVERAGEIFS(C$4:C$13,A$4:A$13,A19,B$4:B$13,B19)
C19{=INDEX(C$4:C$13,MATCH(A19&"|"&B19,A$4:A$13&"|"&B$4:B$13,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
file1


Book1
ABC
1Part No.DestinationPrice
2AQ-123CN$13.00
3AQ-909HK$76.00
4AQ-987US$23.00
5AQ-671US$34.00
6AQ-234CN$131.00
7AQ-298HK$421.00
8AQ-123US$872.00
9AQ-123HK$909.00
10AQ-123JP$16.00
Sheet1


file2

Book1
ABC
1Part No.DestinationPrice
2AQ-298HK421
3AQ-234CN131
4AQ-123CN13
5AQ-123US872
6AQ-909HK76
7AQ-987US23
8AQ-671US34
Sheet1


In C2 of Sheet1 (in file2), control+shift+enter, and copy down:

=INDEX([file1.xlsx]Sheet1!$C$2:$C$10,MATCH($A2,IF([file1.xlsx]Sheet1!$B$2:$B$10=$B2,[file1.xlsx]Sheet1!$A$2:$A$10),0))
 
Upvote 0
Ok, updated formula, see how this works for you.

C19 INDEX/MATCH Array formula to be confirmed by CSE (Control, Shift, Enter), instructions below.
D19 AVERAGEIFS formula normally entered.

Don't forget to change/adjust cell references/range, and add sheet name, as needed, formula copied down.

ABCD
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-123US$872.00
13AQ-123US$872.00
14
15
16
17
18Part No.DestinationPrice
19AQ-298HK$421.00$421.00
20AQ-234CN$131.00$131.00
21AQ-123CN$13.00$13.00
22AQ-123US$872.00$872.00
23AQ-909HK$76.00$76.00
24AQ-987US$23.00$23.00
25AQ-671US$34.00$34.00

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet586

Worksheet Formulas
CellFormula
D19=AVERAGEIFS(C$4:C$13,A$4:A$13,A19,B$4:B$13,B19)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
C19{=INDEX(C$4:C$13,MATCH(A19&"|"&B19,A$4:A$13&"|"&B$4:B$13,0))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>


Thank you for your help, as of this time I'm still checking the above formula. Will post the result after. :)
 
Upvote 0
Hi @jtakw, your formula really works. #N/A displays if no result found. I want to hide it using IFERROR, sorry I'm not good in excel formula.
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,895
Members
449,194
Latest member
JayEggleton

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