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 :)
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
No. Those are the 2 criteria that I want to search records on. The result should be Mickey and Minnie.


OriginAnimalName Lookup: OriginDisney
WarnerDuckDaffy Lookup: AnimalMouse
DisneyMouseMickey Matches:Mickey
DisneyMouseMinnie Minnie
WarnerBunnyBugs
WarnerPigPorky
DisneyDogGoofy
DisneyDogPluto
20th CentMouseMighty

<COLGROUP><COL style="WIDTH: 130pt; mso-width-source: userset; mso-width-alt: 6172" width=174><COL style="WIDTH: 88pt; mso-width-source: userset; mso-width-alt: 4152" width=117><COL style="WIDTH: 48pt" width=64><COL style="WIDTH: 22pt; mso-width-source: userset; mso-width-alt: 1024" width=29><COL style="WIDTH: 119pt; mso-width-source: userset; mso-width-alt: 5660" width=159><COL style="WIDTH: 86pt; mso-width-source: userset; mso-width-alt: 4096" width=115><TBODY>
</TBODY>

F3, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX($C$2:$C$9,SMALL(IF($A$2:$A$9=$F$1,
  IF($B$2:$B$9=$F$2,ROW($C$2:$C$9)-ROW($C$2)+1)),
  ROWS($F$3:F3))),"")

Or just enter and copy down:
Rich (BB code):
=IFERROR(INDEX($C$2:$C$9,AGGREGATE(14,6,
  (ROW($C$2:$C$9)-ROW($C$2)+1)/(($A$2:$A$9=$F$1)*($B$2:$B$9=$F$2)),
  ROWS($F$3:F3))),"")
 
Upvote 0
OriginAnimalNameLookup: OriginDisney
WarnerDuckDaffyLookup: AnimalMouse
DisneyMouseMickeyMatches:Mickey
DisneyMouseMinnieMinnie
WarnerBunnyBugs
WarnerPigPorky
DisneyDogGoofy
DisneyDogPluto
20th CentMouseMighty

<tbody>
</tbody>


F3, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX($C$2:$C$9,SMALL(IF($A$2:$A$9=$F$1,
  IF($B$2:$B$9=$F$2,ROW($C$2:$C$9)-ROW($C$2)+1)),
  ROWS($F$3:F3))),"")

Or just enter and copy down:
Rich (BB code):
=IFERROR(INDEX($C$2:$C$9,AGGREGATE(14,6,
  (ROW($C$2:$C$9)-ROW($C$2)+1)/(($A$2:$A$9=$F$1)*($B$2:$B$9=$F$2)),
  ROWS($F$3:F3))),"")


This is perfect! Thanks! Can you explain this part of it though: ROW($C$2:$C$9)-ROW($C$2)+1)
 
Upvote 0
This is perfect! Thanks!

You are welcome.

Can you explain this part of it though: ROW($C$2:$C$9)-ROW($C$2)+1)

This creates an integer vector, running from 1 to the size of C2:C8, i.e., {1;2;3;4;5;6;7,8}. In the first formula, the integers which survive the IF filters are fed to INDEX by the SMALL function. In the second formula, it's the division which occasions the filtering of the integer. AGGREGATE ignores error values that division causes. Surviving integers are used by INDEX, function number 14 (which corresponds to SMALL) feeds to it.

Hope this helps.
 
Upvote 0
You are welcome.



This creates an integer vector, running from 1 to the size of C2:C8, i.e., {1;2;3;4;5;6;7,8}. In the first formula, the integers which survive the IF filters are fed to INDEX by the SMALL function. In the second formula, it's the division which occasions the filtering of the integer. AGGREGATE ignores error values that division causes. Surviving integers are used by INDEX, function number 14 (which corresponds to SMALL) feeds to it.

Hope this helps.

Thanks very much for your solution, I was having this same problem, and this helped a lot!
 
Upvote 0
HI
please explain why we are using ctrl+Shift+enter. and from where we can take the deep knowledge of these combination.
please suggest.
 
Upvote 0
HI
please explain why we are using ctrl+Shift+enter. and from where we can take the deep knowledge of these combination.
please suggest.

thanks for your post, this is very useful for me.
but can you explain us use of cntrl+Shift+enter in array.

Rich (BB code):

=IFERROR(INDEX($C$2:$C$9,SMALL(IF($A$2:$A$9=$F$1,
  IF($B$2:$B$9=$F$2,ROW($C$2:$C$9)-ROW($C$2)+1)),
  ROWS($F$3:F3))),"")

IF-conditionals which occur within the SMALL function (are set up to) process arrays when they test the A-range and B-range for equality to F1 and F2, respectively, and generate an integer array, i.e., ROW($C$2:$C$9)-ROW($C$2)+1. When a formula is set up to process and generate aarays, Excel, as required by design, must be informed about this by applying control+shift+enter.
 
Upvote 0
Hello,

Had a more elaborate request about the index matching. Here's a sample of my data:

Test
Section
Components
BMP
Section 1
Glucose
BMP
Creatinine
BMP
Sodium
Electrolyte
Section 2
Sodium
Electrolyte
Section 3
Potassium
Electrolyte
Chloride

<tbody>
</tbody>

This is the lookup table, looking up the components in the above table to return tests and sections

Component
Test
Section
Glucose
BMP
Section 1
Creatinine
BMP
Section 1
Sodium
BMP, Electrolyte
Section 1, Section 2, Section 3
Potassium
Electrolyte
Section 2, Section 3
Chloride
Electrolyte
Section 2, Section 3

<tbody>
</tbody>

So more or less I want a way to lookup a component and return all tests it might be in as well as all sections that are connected to the test. Components are in one sheet by themselves, with tests in another sheet indicating what components belong to the test and what sections the test belongs to.

Please let me know if you need clarification or more information.
 
Upvote 0

Forum statistics

Threads
1,215,419
Messages
6,124,798
Members
449,189
Latest member
kristinh

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