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 :)
 
Ok, nice job guys, some really powerful and streamlined code in this thread for sorting data on single and multiple criteria types.

But lets take it a step further, and this is where I got seriously stuck using embedded array index match functions to try to get rid of non-uniques.

So, here's the question, imagine, now going back to the first page, and the first table, that there is not just one mouse named Mickey but (say 4) but we only want to identify the first occurrence, then subsequently bypass it each subsequent time it pops up; as well for any other duplicate.

How would we modify this code to remove non-uniques?
 
Last edited:
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Using the example I linked to in my post, the data and results should look like this:

Part NoAssemblyLookupMatch 1Match 2
DuckDaffyDuckDaffy
MouseMickeyMouseMickeyMinnie
MouseMinnieBunnyBugs
BunnyBugsPigPorky
PigPorkyDogGoofyPluto
DogGoofy
DogPluto

<tbody>
</tbody>

This one, sorry for being vague.
 
Upvote 0
So here's an example of what I was asking, and the output that I'm looking for: basically we take the original formula, but remove any subsequent non-uniques from it.


Part NoAssemblyLookupMatch 1Match 2
DuckDaffyDuckDaffy
MouseMickeyMouseMickeyMickey
MouseMickeyBunnyBugs
BunnyBugsPigPorky
PigPorkyDogGoofyPluto
DogGoofy
DogPluto
MouseMickey
MouseMickey
MouseMinnie
DogPluto
DogPluto

<tbody>
</tbody>
 
Last edited:
Upvote 0
Sorry, i was editing and timer ran out on making edits. Here's what I'm looking for.


AnimalNameLookupMatch 1Match 2
DuckDaffyDuckDaffy
MouseMickeyMouseMickeyMinnie
MouseMickeyBunnyBugs
MouseMickeyPigPorky
BunnyBugsDogGoofyPluto
PigPorky
PigPorky
DogGoofy
DogGoofy
DogGoofy
DogPluto
DogPluto

<tbody>
</tbody>
[/QUOTE]
 
Upvote 0
So here's an example of what I was asking, and the output that I'm looking for: basically we take the original formula, but remove any subsequent non-uniques from it.
[...]

Sorry, i was editing and timer ran out on making edits. Here's what I'm looking for.

[...]

Row\Col
A​
B​
C​
D​
E​
F​
1​
Part NoAssemblyPart NoPart of
2​
DuckDaffyDuckDaffy
3​
MouseMickeyMouseMickeyMinnie
4​
MouseMickeyBunnyBugs
5​
MouseMickeyPigPorky
6​
BunnyBugsDogGoofyPluto
7​
MouseMinnie
8​
PigPorky
9​
PigPorky
10​
DogGoofy
11​
DogGoofy
12​
DogGoofy
13​
DogPluto
14​
DogPluto

E2, control+shift+enter, not just enter, copied across, and down:
Rich (BB code):

=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
Hi Guys..I am hoping what I have as a query would be a continuation on this thread itself.


I have a sheet (Sheet1) with a list of companies (112 companies) and its market cap.


On another tab in the same worksheet I have some other companies (762 companies) from which I hope to match some companies to the companies on Sheet1 as suitable peers. The condition is that the market cap should be in a range of +/-30% of the market cap of the companies in Sheet1


To give an example

Sheet 1 looks like this

Company NamesMkt.Cap30%-30%
A10000130007000
B200002600014000
C13000016900091000
D200002600014000
E500006500035000
F300003900021000
G400005200028000

<tbody>
</tbody>



Sheet 2 looks like:

Company NameMarket Cap
AAA170000
BBB20000
CCC40000
DDD2000
EEE30000
FFF1000
GGG60000
HHH70000
III19000
JJJ29000
KKK30000

<tbody>
</tbody>


For each company in Sheet 1, there will be more than one peer. The peers for A should return Companies from AAA to KKK which have a market cap in the range between 13000 and 7000.

In my best case scenario, a peer for company A would not be considered as a peer for company B so as not to affect further calculations.

Any help would be welcome.

Thanks in advance.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,215
Members
448,874
Latest member
b1step2far

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