![]() |
VLookup and Indirect
I am currently using INDIRECT to get the lookup_value for VLOOKUP
The formula I am using is: =VLOOKUP(INDIRECT(D2),INDIRECT("'"&B2&"'!A2:F20"), 2,) where D2 is a text string (example:Akan 1-1) When I use the above formula I get #Ref If I place D2 in quotes: =VLOOKUP(INDIRECT("D2"),INDIRECT("'"&B2&"'!A2:F20" ),2,). The correct result is returned. However this locks the reference to D2. I need to be able to use this code so that If I move it to the 3rd column it will read D3 and I would prefer not to change the number each time. I have also tried the following formulas and they all return #Ref for the lookup_value. =VLOOKUP(INDIRECT("""&D2&"""),INDIRECT("'"&B2&"'!A 2:F20"),2,) =VLOOKUP(INDIRECT(""""&D2&""""),INDIRECT("'"&B2&"' !A2:F20"),2,) I used the formula auditing to determine where the problem is the lookup_value. The rest of the formula works just fine. Thanks in advance for the help. |
VLookup and Indirect
Try
=VLOOKUP(D2,INDIRECT("'"&B2&"'!A2:F20"),2,0) If this post helps click Yes --------------- Jacob Skaria "Will Cross" wrote: I am currently using INDIRECT to get the lookup_value for VLOOKUP The formula I am using is: =VLOOKUP(INDIRECT(D2),INDIRECT("'"&B2&"'!A2:F20"), 2,) where D2 is a text string (example:Akan 1-1) When I use the above formula I get #Ref If I place D2 in quotes: =VLOOKUP(INDIRECT("D2"),INDIRECT("'"&B2&"'!A2:F20" ),2,). The correct result is returned. However this locks the reference to D2. I need to be able to use this code so that If I move it to the 3rd column it will read D3 and I would prefer not to change the number each time. I have also tried the following formulas and they all return #Ref for the lookup_value. =VLOOKUP(INDIRECT("""&D2&"""),INDIRECT("'"&B2&"'!A 2:F20"),2,) =VLOOKUP(INDIRECT(""""&D2&""""),INDIRECT("'"&B2&"' !A2:F20"),2,) I used the formula auditing to determine where the problem is the lookup_value. The rest of the formula works just fine. Thanks in advance for the help. |
VLookup and Indirect
That worked Thanks
I guess that's what I get for making it complicated. "Jacob Skaria" wrote: Try =VLOOKUP(D2,INDIRECT("'"&B2&"'!A2:F20"),2,0) If this post helps click Yes --------------- Jacob Skaria "Will Cross" wrote: I am currently using INDIRECT to get the lookup_value for VLOOKUP The formula I am using is: =VLOOKUP(INDIRECT(D2),INDIRECT("'"&B2&"'!A2:F20"), 2,) where D2 is a text string (example:Akan 1-1) When I use the above formula I get #Ref If I place D2 in quotes: =VLOOKUP(INDIRECT("D2"),INDIRECT("'"&B2&"'!A2:F20" ),2,). The correct result is returned. However this locks the reference to D2. I need to be able to use this code so that If I move it to the 3rd column it will read D3 and I would prefer not to change the number each time. I have also tried the following formulas and they all return #Ref for the lookup_value. =VLOOKUP(INDIRECT("""&D2&"""),INDIRECT("'"&B2&"'!A 2:F20"),2,) =VLOOKUP(INDIRECT(""""&D2&""""),INDIRECT("'"&B2&"' !A2:F20"),2,) I used the formula auditing to determine where the problem is the lookup_value. The rest of the formula works just fine. Thanks in advance for the help. |
All times are GMT +1. The time now is 10:43 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com