VLOOKUP where LOOKUP range is two columns

Jon Jagd

Board Regular
Joined
Jul 31, 2002
Messages
72
Hi

I need to make a VLOOKUP in a sheet which I do not own or control the layout of. Therefore I cannot add any columns in the source to assist me in my lookup.

My VLOOKUP needs to look at two values/columns since the value in one column is not a unique identifier. This is easy in the value I want to lookup but not so easy in the lookup range in the source sheet. Ideally I would like to write my formula something like this:

=VLOOKUP(A2&B2;CONCATENATE('[OtherWorkbook.xlsx]Sheet1'!$M$2:$M$9;'[OtherWorkbook.xlsx]Sheet1'!$N$2:$N$9);2;FALSE)

But that obviously does not work. Any suggetions on how to slve this?

Jon
 
Wow. Thank you very much for the response.

So it seems like it is almost worth it to change the format of the table instead?
I was just trying to avoid dragging and dropping the x down (because in my current table, I'd have to do that over 30 times).

Is there anything else you'd suggess other than manually dragging and dropping?

Thanks again!

If we accept the cost of having a lay-out as specified...

H2, control+shift+enter, not just enter:
Rich (BB code):
=VLOOKUP(G2,OFFSET($B$2,MATCH(F2,$A$2:$A$5,0)-1,0,
   LOOKUP(9.99999999999999E+307,CHOOSE({1,2},ROWS($A$2:$A$5),
   MATCH(1,IF(1-(A2:A5=""),IF(1-(A2:A5=F2),
   IF(ROW(A2:A5)-ROW(A2)+1>MATCH(F2,$A$2:$A$5,0),1))),0)))-
   MATCH(F2,$A$2:$A$5,0)+1,2),2,0)

If we reserve a cell for the repetitive part in this formula...

I2, just enter:
Rich (BB code):
=MATCH(F2,$A$2:$A$5,0)

H2, still confirmed with control+shift+enter, would become:
Rich (BB code):
=VLOOKUP(G2,OFFSET($B$2,I2-1,0,
  LOOKUP(9.99999999999999E+307,CHOOSE({1,2},ROWS($A$2:$A$5),
  MATCH(1,IF(1-(A2:A5=""),IF(1-(A2:A5=F2),
  IF(ROW(A2:A5)-ROW(A2)+1>I2,1))),0)))-I2+1,2),2,0)
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Wow. Thank you very much for the response.

You are welcome.

[uote]So it seems like it is almost worth it to change the format of the table instead?
I was just trying to avoid dragging and dropping the x down (because in my current table, I'd have to do that over 30 times). [/quote]

The 2nd set up could be admissible, that's, not too bad qua performance.

Is there anything else you'd suggess other than manually dragging and dropping?

Thanks again!

You could try recording a macro.
 
Upvote 0
OK, thanks again!

You are welcome.

[uote]So it seems like it is almost worth it to change the format of the table instead?
I was just trying to avoid dragging and dropping the x down (because in my current table, I'd have to do that over 30 times).

The 2nd set up could be admissible, that's, not too bad qua performance.



You could try recording a macro.[/QUOTE]
 
Upvote 0

Forum statistics

Threads
1,226,224
Messages
6,189,733
Members
453,566
Latest member
ariestattle

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