Index Match data to provide multiple results in columns

lomond44

New Member
Joined
May 6, 2014
Messages
7
I need some help with a spreadsheet that contains 2 worksheets.

The first sheet contains part numbers and the assemblies that they are used in. Each part number can be used in many assemblies.

On the 2nd sheet is a list of just the part numbers without duplicates. The aim is to create columns to the right of each part number that identifies all the assemblies that the part is used in.

I have looked at this link How To Return Multiple Match Values in Excel Using INDEX-MATCH or VLOOKUP | eImagine Technology Group but I do not want the results to be down a column but to go across the row.

Any help appreciated :)
 
Where is the link to the formula - I don't see it.
thanks

Using the example I linked to in my post, the data and results should look like this:

Part No
Assembly
Lookup
Match 1
Match 2
Duck
Daffy
Duck
Daffy
Mouse
Mickey
Mouse
Mickey
Minnie
Mouse
Minnie
Bunny
Bugs
Bunny
Bugs
Pig
Porky
Pig
Porky
Dog
Goofy
Pluto
Dog
Goofy
Dog
Pluto

<tbody>
</tbody>
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
@ poer24

=IF(ISERROR(INDEX($A$2:$T$2500,SMALL(IF($C$2:$C$2500=$AA$1,ROW($C$2:$C$2500)),ROW(4:4)),5)),"",INDEX($A$2:$T$2500,SMALL( IF($C$2:$C$2500=$AA$1,ROW($C$2:$C$2500)),ROW(4:4)),5))

is not a formula that I would recommend or post... (There are enough people who start a site on Excel and propagate this kind of nonsense, alas.)

Try rather... In AB1 control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($E$2:$E$2500,SMALL(IF($C$2:$C$2500=$AA$1,ROW($C$2:$C$2500)-ROW($C$2)+1),ROWS($AB$1:$AB1))),"")
 
Upvote 0
Hi,

I have a similar issue with these posts and I can't seem to figure it out. I have two tables on two separate sheets. Column A on both sheets is the one which matches the other. I want to find all the matches for Sheet 2:A from Sheet 1:A and put Sheet 1:B in Sheet 2:C-X.

For example;

Sheet 1: ASheet 1: B
13244BS4W
8952BCPLSAFCT5L
8952WMB3FW
8952EB3FX
8952MFC10STHF

<tbody>
</tbody>

Sheet 2: ASheet 2: BSheet 2: Match 1Sheet 2: Match 2Sheet 2: Match 3Sheet 2: Match 4
13244bbm1bs4w
8952hw10bcplsafct5lwmb3fxeb3fxmfc10sthf
8952hwa20bcplsafct5lwmb3fxeb3fxmfc10sthf
8952rlx4bcplsafct5lwmb3fxeb3fxmfc10sthf

<tbody>
</tbody>

I attempted to use the formula you've used in reply #4 but I can't seem to get it to work (I did press Ctrl + Shift + Enter)
 
Upvote 0
@ Nugget_Leodis

Sheet1
(data)

Row\Col
A​
B​
1​
2​
13244​
BS4W
3​
8952​
BCPLSAFCT5L
4​
8952​
WMB3FW
5​
8952​
EB3FX
6​
8952​
MFC10STHF
7​

Sheet2
(processing)

Row\Col
A​
B​
C​
D​
E​
1​
2​
13244​
BS4W
3​
8952​
BCPLSAFCT5LWMB3FWEB3FXMFC10STHF
4​

In B2 control+shift+enter, not just enter, copy across, and down:

=IFERROR(INDEX(Sheet1!$B$2:$B$6,SMALL(IF(Sheet1!$A$2:$A$6=$A2,ROW(Sheet1!$B$2:$B$6)-ROW(Sheet1!$B$2)+1),COLUMNS($B$2:B2))),"")
 
Upvote 0
Hi Aladin,

Could you elaborate the below functions for me...? As I am not getting couple of ranges you referred to MATCH fuction, also before MATCH function threre is IF($B$2:$B$14<>"" statement which I am not getting as well. thanks in advance.

=IFERROR(INDEX($B$2:$B$14,SMALL(IF(FREQUENCY(IF($A$2:$A$14=$D2,
IF($B$2:$B$14<>"",MATCH($B$2:$B$14,$B$2:$B$14,0))),
ROW($B$2:$B$14)-ROW($B$2)+1),ROW($B$2:$B$14)-ROW($B$2)+1),
COLUMNS($E2:E2))),"")
 
Upvote 0
@ proficient

This refers to the formula which is forwarded in post #26 .

The bit:

FREQUENCY(IF($A$2:$A$14=$D2,
IF($B$2:$B$14<>"",MATCH($B$2:$B$14,$B$2:$B$14,0))),
ROW($B$2:$B$14)-ROW($B$2)+1)

of the formula creates maps the occurrences of the non-blank cells in B2:B14 to the bin-array ROW(B2:B14)-ROW(B2)+1, which correspond to the occurrences of D2 in A2:A14.

A. $B$2:$B$14<>"" means: skip blanks/empty cells.

B. MATCH($B$2:$B$14,$B$2:$B$14,0) matches the range interest against itself, leading to numbers showing matches.

C. FREQUENCY works with numbers (data_array) whose occurrences it classifies into bins_array.

_____________________________
Intermezzo:

itemmatch item set against itself (data_array)bins_arraycount of Bresults of count B
JAD11from 0 to >= 12 = 2 times 1
VAD22from 2 to >= 21 = 1 times 2
JAD13from 3 to >= 30 = 0 times 3
KAD44from 4 to >= 41 = 1 times 4
rest0 = 0 times anything beyond 4
How many results are above 0?
3
This count is precisely the number of unique items JAD, VAD, and KAD.

<tbody>
</tbody>

_____________________________

D. The IF bit, i.e.

IF(FREQUENCY(IF($A$2:$A$14=$D2,
IF($B$2:$B$14<>"",MATCH($B$2:$B$14,$B$2:$B$14,0))),
ROW($B$2:$B$14)-ROW($B$2)+1),ROW($B$2:$B$14)-ROW($B$2)+1)

>>

IF(non-zero results of frequency, ROW($B$2:$B$14)-ROW($B$2)+1)


of the formula returns the rows of non-zero results.

E. Feeding the rows from [D] to INDEX looking at $B$2:$B$14 one by one by means of SMALL, we get the list of unique items from $B$2:$B$14.

See for more:
https://www.mrexcel.com/forum/excel...ing-sum-if-frequency-match-2.html#post3156949

Hope this helps.
 
Last edited:
Upvote 0
@ proficient

This refers to the formula which is forwarded in post #26 .

The bit:

FREQUENCY(IF($A$2:$A$14=$D2,
IF($B$2:$B$14<>"",MATCH($B$2:$B$14,$B$2:$B$14,0))),
ROW($B$2:$B$14)-ROW($B$2)+1)

of the formula creates maps the occurrences of the non-blank cells in B2:B14 to the bin-array ROW(B2:B14)-ROW(B2)+1, which correspond to the occurrences of D2 in A2:A14.

A. $B$2:$B$14<>"" means: skip blanks/empty cells.

B. MATCH($B$2:$B$14,$B$2:$B$14,0) matches the range interest against itself, leading to numbers showing matches.

C. FREQUENCY works with numbers (data_array) whose occurrences it classifies into bins_array.

_____________________________
Intermezzo:

itemmatch item set against itself (data_array)bins_arraycount of Bresults of count B
JAD11from 0 to >= 12 = 2 times 1
VAD22from 2 to >= 21 = 1 times 2
JAD13from 3 to >= 30 = 0 times 3
KAD44from 4 to >= 41 = 1 times 4
rest0 = 0 times anything beyond 4
How many results are above 0?
3
This count is precisely the number of unique items JAD, VAD, and KAD.

<tbody>
</tbody>

_____________________________

D. The IF bit, i.e.

IF(FREQUENCY(IF($A$2:$A$14=$D2,
IF($B$2:$B$14<>"",MATCH($B$2:$B$14,$B$2:$B$14,0))),
ROW($B$2:$B$14)-ROW($B$2)+1),ROW($B$2:$B$14)-ROW($B$2)+1)

>>

IF(non-zero results of frequency, ROW($B$2:$B$14)-ROW($B$2)+1)


of the formula returns the rows of non-zero results.

E. Feeding the rows from [D] to INDEX looking at $B$2:$B$14 one by one by means of SMALL, we get the list of unique items from $B$2:$B$14.

See for more:
https://www.mrexcel.com/forum/excel...ing-sum-if-frequency-match-2.html#post3156949

Hope this helps.

The way you explain the formula step by step is awesome, thank you so much.
 
Upvote 0
Hey guys, I was using this formula to handle imported date for my job. Everything about this formula works amazingly.

=IF(ISERROR(INDEX($A$1:$B$8,SMALL(IF($A$1:$A$8=$E$1,ROW($A$1:$A$8)),ROW(1:1)),2)),"",INDEX($A$1:$B$8,SMALL(IF($A$1:$A$8=$E$1,ROW($A$1:$A$8)),ROW(1:1)),2))

However, I'm running to a little issue. I need for this formula to look up values/data from the first two columns as opposed of just A1:A8. Can anyone help me out with this?


So we have this: (Thanks for this example btw)
AnimalNameLookup:Mouse
DuckDaffyMatches:Mickey
MouseMickeyMinnie
MouseMinnie
BunnyBugs
PigPorky
DogGoofy
DogPluto

<tbody>
</tbody>


I trying to get the "Lookup: Mouse" To lookup not just values from Column A but also Column B. Like this

Animal 1Animal 2ItemsLookupMouse
DuckMockingjay3Matches12
MouseCat1214
CatDog49
MouseElephant14
LionMouse9

<tbody>
</tbody>


In the last row, "Mouse" appears on Column B. Is there a way to make the formula read column B as well as column A? Also, I do not intent to have repeated values in a row. In case that makes things easier?

Thank you!
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,975
Members
449,095
Latest member
Mr Hughes

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