I'm trying to do a vlookup (in a cell, not VBA) where the range is determined by a variable stored in another cell.
That is the lookup without the variable. It works great.
I made a new section of the local worksheet to create the path and fill in the sheet name:
So it seems to me that this formula should work:
When I show the calculation steps, I can see it pulling the value, but it returns a #ref error when it evaluates the indirect() function.
If I change it to
It doesn't pull the value from the cell, but tries to use N3 as the range.
Anyone see where I'm going wrong?
Code:
=VLOOKUP(TRIM(A3)&"*",'\\030-DC1\Company$\ADOE 30\re-entry calc\[ReEntry Calculations.xlsx]August 13'!$A$2:$N$150,6,0)
I made a new section of the local worksheet to create the path and fill in the sheet name:
Code:
O1 determines the local sheet name (in this case, "August 13")
N1 contains the path '\\030-DC1\Company$\ADOE 30\re-entry calc\[ReEntry Calculations.xlsx]
N2 Contains the range '!$A$2:$N$150
N3 sticks them all together =CONCATENATE(N1,O1,N2)
That is all working fine and N3 ends up with the value
[I]'\\030-DC1\Company$\ADOE 30\re-entry calc\[ReEntry Calculations.xlsx]August 13'!$A$2:$N$150[/I]<table style="border-collapse: collapse; width: 48pt;" border="0" cellpadding="0" cellspacing="0" width="64"><tr style="height: 15pt;" height="20"><td class="xl63" style="height: 15pt; width: 48pt;" height="20" width="64">
</td></tr></table>
So it seems to me that this formula should work:
Code:
=VLOOKUP(TRIM(A2)&"*",[B]INDIRECT($N$3,1)[/B],6,0)
If I change it to
Code:
=VLOOKUP(TRIM(A2)&"*",[B]$N$3[/B],6,0)
Anyone see where I'm going wrong?
Last edited: