ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Variable lookup (https://www.excelbanter.com/excel-worksheet-functions/206711-variable-lookup.html)

Rod

Variable lookup
 
Hello,

Im not sure if this double posted because me browser froze...

I have excel range names of:

tblCA10
tblCA15
tblCA20
tblCA25
tblCA30
tblCA35

I would like to do a lookup like this:

=VLOOKUP(C2,tblCAB2,9,FALSE)

where tblCAB2 will be determined by the value entered in B2, i.e. if the
value in B2 is 15 then tblCA15 will be searched.

Thanks

Max

Variable lookup
 
=VLOOKUP(C2,tblCAB2,9,FALSE)
where tblCAB2 will be determined by the value entered in B2,


Try INDIRECT, ie: =VLOOKUP(C2,INDIRECT(B2),9,FALSE)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:19,000 Files:362 Subscribers:62
xdemechanik
---


Rod

Variable lookup
 
#REF! error

"Max" wrote:

=VLOOKUP(C2,tblCAB2,9,FALSE)
where tblCAB2 will be determined by the value entered in B2,


Try INDIRECT, ie: =VLOOKUP(C2,INDIRECT(B2),9,FALSE)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:19,000 Files:362 Subscribers:62
xdemechanik
---


Max

Variable lookup
 
Sorry, missed your last line earlier:
if the value in B2 is 15 then tblCA15 will be searched.


Try: =VLOOKUP(C2,INDIRECT("tblCA"&B2),9,FALSE)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:19,000 Files:362 Subscribers:62
xdemechanik
---


Max

Variable lookup
 
"Rod" wrote:
#REF! error


Sorry, missed your last line earlier:
if the value in B2 is 15 then tblCA15 will be searched.


Try: =VLOOKUP(C2,INDIRECT("tblCA"&B2),9,FALSE)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:19,000 Files:362 Subscribers:62
xdemechanik
---

Rod

Variable lookup
 
Perfect!

"Max" wrote:

Sorry, missed your last line earlier:
if the value in B2 is 15 then tblCA15 will be searched.


Try: =VLOOKUP(C2,INDIRECT("tblCA"&B2),9,FALSE)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:19,000 Files:362 Subscribers:62
xdemechanik
---


Max

Variable lookup
 
Welcome
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:19,000 Files:362 Subscribers:62
xdemechanik
---
"Rod" wrote
Perfect!





All times are GMT +1. The time now is 02:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com