Index match function

ericlzh

New Member
Joined
Jun 24, 2019
Messages
8
Dear All,

I could like to use INDEX MATCH function to obtain a specific data that i need from Raw Data. How can i implement the formula?
Please refer to example below.
Thank you all.

Raw Data (Sheet 1):-
[TABLE="width: 360"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD]Master Account#[/TD]
[TD]Buyer Account[/TD]
[TD]Seller Account[/TD]
[/TR]
[TR]
[TD]1ABCDG[/TD]
[TD]ABCD[/TD]
[TD]ABCD[/TD]
[/TR]
[TR]
[TD]1EFGHG[/TD]
[TD]EFGH[/TD]
[TD]EFGH[/TD]
[/TR]
[TR]
[TD]1IJKLG[/TD]
[TD]IJKL[/TD]
[TD]IJKL[/TD]
[/TR]
[TR]
[TD]1MNOPG[/TD]
[TD]MNOP-L[/TD]
[TD]MNOP-S[/TD]
[/TR]
</tbody>[/TABLE]


Formula Function to be applied (Sheet 2):-
[TABLE="width: 360"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD][TABLE="width: 360"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD]Buyer
Account[/TD]
[TD]Seller
Account[/TD]
[TD]Expected Result[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1ABCDG[/TD]
[TD]ABCD[/TD]
[/TR]
[TR]
[TD]1EFGHG[/TD]
[TD]0[/TD]
[TD]EFGH[/TD]
[/TR]
[TR]
[TD]1MNOPG[/TD]
[TD]0[/TD]
[TD]MNOP-L[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1MNOPG[/TD]
[TD]MNOP-S[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Hi, Hopefully this would work:


Book1
ABCD
1BuyerSellerTraded productExpected Results
21ABCDG0OilABCD-1
301ABCDGMetalsABCD-2
401EFGHGOilEFGH-S
Sheet2
Cell Formulas
RangeFormula
D2{=INDEX(Sheet1!$C$3:$C$5,MATCH(IF(A2=0,B2,A2)&C2,Sheet1!$A$3:$A$5&Sheet1!$D$3:$D$5,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try regular formula


Book1
ABCD
1BuyerSellerTraded productExpected Results
21ABCDG0OilABCD-1
301ABCDGMetalsABCD-2
401EFGHGOilEFGH-S
Sheet2
Cell Formulas
RangeFormula
D2=INDEX(Sheet1!$B$2:$C$4,SUMPRODUCT((Sheet1!$A$2:$A$4=IF(A2<>0,A2,B2))*(Sheet1!$D$2:$D$4=C2)*(ROW(Sheet1!$D$2:$D$4)))-1,IF(A2<>0,1,2))
 
Upvote 0
Hi Aryatect,

Your formula works fine but it can only applied to the Seller Leg and not the Buyer Leg.

Hence, I am applying using Dante's formula. Thx!
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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