#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rod Rod is offline
external usenet poster
 
Posts: 108
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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
---

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rod Rod is offline
external usenet poster
 
Posts: 108
Default 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
---

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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
---

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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
---


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rod Rod is offline
external usenet poster
 
Posts: 108
Default 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
---

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Variable lookup

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookup using variable name Rod Excel Worksheet Functions 1 October 17th 08 12:09 AM
can't lookup a value to the left of my variable Gluefoot Excel Worksheet Functions 6 July 9th 08 11:38 PM
3 variable lookup rooter Excel Worksheet Functions 6 May 10th 08 10:19 PM
Variable Lookup/Double Lookup Ryan[_2_] Excel Worksheet Functions 8 May 14th 07 09:44 PM
How can I set a variable for which column to lookup? Regnab Excel Discussion (Misc queries) 1 July 12th 06 10:43 PM


All times are GMT +1. The time now is 06:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"