vlookup - one to many relationship problem

glorber

New Member
Joined
Aug 3, 2007
Messages
17
Hi,
I have two large excel worksheets (A and B) each containing columns of 'ID' and 'date' and other columns that differ between the files. Each spreadsheet has multiple entries of a given ID and identicle matching dates. I would like to perform a search based on a given ID and date in file A and find the matching ID and date in file B. then extract a third value from B from the appropriate row.
I thought of using vlookup:

if(vlookup(IDInA,RangeInB,colOfDateInB,false)=DateinA,vlookup(...))

The problem is that vlookup stops searching after the first match (ID and Date) between the files. Any way around that?

I Know it sound copmlicated but I hope I managed to explain my problem.
Thanks.
 

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.

lotsasmiles

New Member
Joined
Aug 13, 2007
Messages
5
Would it be too complicated to put in some sort of loop? I believe the vlookup stops after one because the destination cell can only have one value in it. Hope this helps, if only to give you a different way to look at it. Good luck!
 
Upvote 0

glorber

New Member
Joined
Aug 3, 2007
Messages
17
I was thinking of a loop yet I'm not sure how to do that. Only thing that comes to mind is VisualBasic, and I'm not that familiar with it.
 
Upvote 0

Forum statistics

Threads
1,190,600
Messages
5,981,865
Members
439,740
Latest member
TheFlatTire

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
Top