how to bring in all the matching rows from a different sheet?

bigdan

Well-known Member
Joined
Oct 5, 2009
Messages
846
Office Version
  1. 2013
Platform
  1. Windows
EDIT - I can't use VBA at work so I'd appreciate a non-VBA option please :)


I have two workbooks that I need to play with.

Both have an Opportunity ID field. I'm using the first one for most of my work, but the second one has a Products field that I need. Each Opp ID is associated with one or more Products.

How do I bring in the various Products associated with an Opp ID?


Here's the second spreadsheet:

[TABLE="width: 500"]
<tbody>[TR]
[TD]A1[/TD]
[TD]Computer[/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]Phone[/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]Keyboard[/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]Cup[/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]Headphones[/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]Laptop[/TD]
[/TR]
</tbody>[/TABLE]


So in the first spreadsheet, when I start with one row for A2, and I don't know how many associated rows there are in the second one, how would I approach this?
 
Last edited:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
This is what the first spreadsheet would have

[TABLE="width: 500"]
<tbody>[TR]
[TD]A1[/TD]
[TD]irrelevant data[/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]irrelevant data[/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]irrelevant data[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I have to create a third spreadsheet, mainly with information copy/pasted from the first one, but then have to break it up by product, which I would extract from the second one. It could've been as easy as a vlookup if each Opp ID had a single product but unfortunately that's not the case. And we also don't know how many products are associated with each Opp ID, though I believe it's always between 1 and 6.
 
Upvote 0
So where would Phone keyboard and cup go against A2 in your first spreadsheet, ie what are you expecting the output to look like?
 
Upvote 0
In the third spreadsheet phone and keyboard and cup would all be alongside A2. So there would have to be 3 separate rows for A2. Which is the problem, I wouldn't know how many rows to create for each Opp ID. I suppose I could create 6 rows for each Opp ID and then delete the unused ones.
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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