Issue with vlookup and indirect

Michal_PVP

New Member
Joined
Aug 19, 2011
Messages
3
Hey Guys,

This is proabaly a popular question but I have a problem definining a range for the 'vlookup' function, where the range is defined by the 'indirect' function referencing a different worksheet.

The formula is as follows:

=VLOOKUP(EX2,INDIRECT("Add On Matrix'!B"&'Add On Matrix'!AL13&":'Add On Matrix'!AC"&'Add On Matrix'!AL14),MATCH(ER2,'Add On Matrix'!D2:AC2,0)+2,FALSE)

It collapses because of the range for the function, and I get a #REF! error in the end.

Many thanks in advance!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hey Guys,

This is proabaly a popular question but I have a problem definining a range for the 'vlookup' function, where the range is defined by the 'indirect' function referencing a different worksheet.

The formula is as follows:

=VLOOKUP(EX2,INDIRECT("Add On Matrix'!B"&'Add On Matrix'!AL13&":'Add On Matrix'!AC"&'Add On Matrix'!AL14),MATCH(ER2,'Add On Matrix'!D2:AC2,0)+2,FALSE)

It collapses because of the range for the function, and I get a #REF! error in the end.

Many thanks in advance!
Try to post the formula without INDIRECT and add which parts must be fed to INDIRECT.
 
Upvote 0
Sure, here goes:

=VLOOKUP(EX2,Range Given by Indirect,MATCH(ER2,'Add On Matrix'!D2:AC2,0)+2,FALSE)

I ma trying to look up a value from an array imported to a separate worksheet: "Add On Matrix".

Now the range, in question is B208:AC246 in the worksheet in question and the values of the relevant range boundaries are given in cells: AL13 = 208 and AL14=246 and these are defined by match functions which find the necessary rows (range boundaries) as the array changes on a weekly basis.
Now the indirect function comes in which is supposed to define the range by referencing the worksheet "Add On Matrix":

INDIRECT("Add On Matrix'!B"&'Add On Matrix'!AL13&":'Add On Matrix'!AC"&'Add On Matrix'!AL14)

That's where the problem occurs as I get a #REF! error so I'm guessing I missed something in the INDIRECT formula.

Thanks for your help.
 
Upvote 0
=VLOOKUP(EX2,INDIRECT("Add On Matrix'!B"&'Add On Matrix'!AL13&":'Add On Matrix'!AC"&'Add On Matrix'!AL14),MATCH(ER2,'Add On Matrix'!D2:AC2,0)+2,FALSE)

Try to replace upper green part with below:

Code:
INDIRECT("[COLOR=red][B]'[/B][/COLOR]Add On Matrix'!B"&'Add On Matrix'!AL13&"[B][COLOR=red]:AC[/COLOR][/B]"&'Add On Matrix'!AL14)
 
Upvote 0
Sure, here goes:

=VLOOKUP(EX2,Range Given by Indirect,MATCH(ER2,'Add On Matrix'!D2:AC2,0)+2,FALSE)

I ma trying to look up a value from an array imported to a separate worksheet: "Add On Matrix".

Now the range, in question is B208:AC246 in the worksheet in question and the values of the relevant range boundaries are given in cells: AL13 = 208 and AL14=246 and these are defined by match functions which find the necessary rows (range boundaries) as the array changes on a weekly basis.
Now the indirect function comes in which is supposed to define the range by referencing the worksheet "Add On Matrix":

INDIRECT("Add On Matrix'!B"&'Add On Matrix'!AL13&":'Add On Matrix'!AC"&'Add On Matrix'!AL14)

That's where the problem occurs as I get a #REF! error so I'm guessing I missed something in the INDIRECT formula.

Thanks for your help.

Try...
Code:
=VLOOKUP(EX2,INDEX('Add On Matrix'!$B:$B,$AL$13):INDEX('Add On Matrix'!$AC:$AC,$AL$14),
    MATCH(ER2,'Add On Matrix'!D2:AC2,0)+2,0)
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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