Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default creating a range reference from cell values

I am try to do a vlookup where the range is built from cell values ex.

=VLOOKUP($K$16,TRIM(B17&"!"&"A1:L32"),3,FALSE)

b17 contains the sheet name

but gives me a #value! error

but works if the range is hard coded

But I really want to build the range dynamiclly

Can anyone help ???
thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 301
Default creating a range reference from cell values

=VLOOKUP($K$16,INDIRECT(B17&"!A1:L32")3,FALSE)

"Robin Krupp" wrote in message
...
I am try to do a vlookup where the range is built from cell values ex.

=VLOOKUP($K$16,TRIM(B17&"!"&"A1:L32"),3,FALSE)

b17 contains the sheet name

but gives me a #value! error

but works if the range is hard coded

But I really want to build the range dynamiclly

Can anyone help ???
thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default creating a range reference from cell values

You'll need to use the INDIRECT function. You could basically just replace
TRIM with INDIRECT in your formula and it should work.

=VLOOKUP($K$16,INDIRECT(B17&"!A1:L32"),3,FALSE)

Not sure why you're using the TRIM function in the first place, unless B17
may contain extra spaces? If so, just place B17 in the TRIM function.
....INDIRECT(TRIM(B17)&"!...

HTH,
Elkar


"Robin Krupp" wrote:

I am try to do a vlookup where the range is built from cell values ex.

=VLOOKUP($K$16,TRIM(B17&"!"&"A1:L32"),3,FALSE)

b17 contains the sheet name

but gives me a #value! error

but works if the range is hard coded

But I really want to build the range dynamiclly

Can anyone help ???
thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default creating a range reference from cell values

=VLOOKUP($K$16,indirect("'" & TRIM(B17) &"'!"&"A1:L32"),3,FALSE)

Are you sure you need the =trim() portion?

Robin Krupp wrote:

I am try to do a vlookup where the range is built from cell values ex.

=VLOOKUP($K$16,TRIM(B17&"!"&"A1:L32"),3,FALSE)

b17 contains the sheet name

but gives me a #value! error

but works if the range is hard coded

But I really want to build the range dynamiclly

Can anyone help ???
thanks


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default creating a range reference from cell values

Try it like this:

=VLOOKUP($K$16,INDIRECT("'"&TRIM(B17)&"'!A1:L32"), 3,0)

--
Biff
Microsoft Excel MVP


"Robin Krupp" wrote in message
...
I am try to do a vlookup where the range is built from cell values ex.

=VLOOKUP($K$16,TRIM(B17&"!"&"A1:L32"),3,FALSE)

b17 contains the sheet name

but gives me a #value! error

but works if the range is hard coded

But I really want to build the range dynamiclly

Can anyone help ???
thanks



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
Creating a Pivot Table to reference values Noncentz303 Excel Worksheet Functions 1 May 9th 07 01:39 AM
Cell reference in a range nick Excel Worksheet Functions 5 September 13th 06 06:16 PM
Creating a link from cell values Capp Excel Discussion (Misc queries) 8 May 8th 06 11:09 PM
Cell Reference with Range Name SCSC Excel Worksheet Functions 2 March 23rd 06 11:32 PM
Creating an EXCEL COUNTIF formula for a range of values Pat Walsh Excel Discussion (Misc queries) 5 January 21st 05 02:57 PM


All times are GMT +1. The time now is 12:42 PM.

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"