HELP on INDEX/MATCH multiple ocurence match values needed ..DRIVING ME CRAZY!!!

buddy1000

Active Member
Joined
Oct 31, 2007
Messages
294
example.xls
ABCD
1CcodeIcodenr.
21000200AA12545811000
31000200DE12545616980
41000200BB54879022960
51000200MM5487528940
61000200PP12487834920
71000200AA12545840900
81000200BB54879046880
91000200KL24554252860
101000200DE12545646880
111000120AA12545852860
121000120TY78425958840
131000120BB54879064820
141000120MQ54878770800
15
16
INPUT 1
example.xls
ABCD
1CcodeIcodenr.
2SABBAA12545811000
3SABBDE12545616980
4SABBBB54879022960
5SABBMM5487528940
6SABBPP12487834920
7SABB-2AA12545840900
8SABBBB54879046880
9SABBKL24554252860
10SABB-2DE12545646880
11BASSAA12545852860
12BASSTY78425958840
13BASSBB54879064820
14BASSMQ54878770800
INPUT 2


I am trying to lookup values with multiple occurence by using Index/match.

I have 3 sheets
Input sheet 1, Input sheet 2 and a Sheet I call Lookup.
In input sheet 1, I have a column Ccode, Icode and nr.
In input sheet 2 ,I have the same columns.
Icode and nr. sheets are SIMILAIR in both sheets.
The Ccode is has different parameters.
The Ccode in Input 1 can be eighter 1000200 or 1000120.
1000200 corresponds to SABB and SABB-2 AND 1000120to BASS
Column Ccode in Input 2 can be SABB, SABB-2 or BASS.

In the Lookup sheet, column C (nr. ) contains the formula
{=INDEX('INPUT 1'!$C$2:$C$65536,MATCH(A3,IF(LOOKUP!B$3:B$65536=B3,LOOKUP!A$3:A$65536),0))} which give sme the nr. corresponding to the Icode and Ccode of Input 1.

THE PROBLEM is using the formula to lookuo column H (nr) for Input 2.
If I use the same formula it does not work and disregards the multiple occurences.

Can anyone help me with a formula that will look at the Icode in columb B (Lookup Sheet), go to INPUT 2 and give me the corresponding nr.
 
I spoke a bit too soon Aladin but it DOESN NOT work for the multiple occurence.
AA125458 and BB548790 occure three times and DE125456 two times.

For both AA125458 and BB548790 (occures twice in 1000200 and once in 1000120) the formula gives for 1000200 twice the first value.


It seems that it distinguishes between 1000200 and 1000120 but not between values that occure twice in 1000200 or twice in 1000120.
This seems very strange since the distinct is made through SAAB and SAAB-2.
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I spoke a bit too soon Aladin but it DOESN NOT work for the multiple occurence.
AA125458 and BB548790 occure three times and DE125456 two times.

For both AA125458 and BB548790 (occures twice in 1000200 and once in 1000120) the formula gives for 1000200 twice the first value.


It seems that it distinguishes between 1000200 and 1000120 but not between values that occure twice in 1000200 or twice in 1000120.
This seems very strange since the distinct is made through SAAB and SAAB-2.

{"BASS";"SABB";"SABB-2";"SABB-3";"etc"}

is wrong. The values must be in ascending order:

{"BASS";"etc","SABB";"SABB-2";"SABB-3"}

By the way, if the two lookup values do not contrue a unique key, the idea of comparison becomes meaningless...
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,212
Messages
6,123,651
Members
449,111
Latest member
ghennedy

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