Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default Referencing a sheet in VLOOKUP

Currently, I have a cell referencing a table on another sheet like so:

=VLOOKUP(A5,'Sheet2'!$J$4:$J$1998,1,TRUE)

But what I want to do is instead of referencing the sheet explicitly (i.e.
Sheet2), I'd like to reference a sheet based on another cell's value. E.g.:

=VLOOKUP(A5,'A2'!$J$4:$J$1998,1,TRUE)
where A2 would have the value "Sheet2".

Is this possible within excel?

--
Thanks!
Max
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Referencing a sheet in VLOOKUP

Look at the indirect formula. It will allow you to change the sheet
references. Just keep in mind that indirect is a volitile function meaning
that it will recalculate every time a calculation occures. If you have
thousands of these formulas then the performance will drop off significantly
(especially since Vlookup is a slow formula).

If that is the case then you might want to use a named range and just change
the named range reference to keep the performance up.
--
HTH...

Jim Thomlinson


"Max" wrote:

Currently, I have a cell referencing a table on another sheet like so:

=VLOOKUP(A5,'Sheet2'!$J$4:$J$1998,1,TRUE)

But what I want to do is instead of referencing the sheet explicitly (i.e.
Sheet2), I'd like to reference a sheet based on another cell's value. E.g.:

=VLOOKUP(A5,'A2'!$J$4:$J$1998,1,TRUE)
where A2 would have the value "Sheet2".

Is this possible within excel?

--
Thanks!
Max

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Referencing a sheet in VLOOKUP

=vlookup(a5,indirect("'" & a2 & "'!j4:j1998"),1,true)

Max wrote:

Currently, I have a cell referencing a table on another sheet like so:

=VLOOKUP(A5,'Sheet2'!$J$4:$J$1998,1,TRUE)

But what I want to do is instead of referencing the sheet explicitly (i.e.
Sheet2), I'd like to reference a sheet based on another cell's value. E.g.:

=VLOOKUP(A5,'A2'!$J$4:$J$1998,1,TRUE)
where A2 would have the value "Sheet2".

Is this possible within excel?

--
Thanks!
Max


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Referencing a sheet in VLOOKUP

=VLOOKUP(A5,Indirect("'" & A2 & "'!$J$4:$J$1998"),1,TRUE)

--
Regards,
Tom Ogilvy


"Max" wrote in message
...
Currently, I have a cell referencing a table on another sheet like so:

=VLOOKUP(A5,'Sheet2'!$J$4:$J$1998,1,TRUE)

But what I want to do is instead of referencing the sheet explicitly (i.e.
Sheet2), I'd like to reference a sheet based on another cell's value.

E.g.:

=VLOOKUP(A5,'A2'!$J$4:$J$1998,1,TRUE)
where A2 would have the value "Sheet2".

Is this possible within excel?

--
Thanks!
Max



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
Sheet Referencing - autofilling sheet names Pat Excel Worksheet Functions 2 June 4th 09 03:50 AM
Vlookup returning NA when referencing cell data to another sheet Giacomo[_2_] Excel Worksheet Functions 3 March 31st 09 11:30 PM
copy formula referencing sheet name to another sheet Tat Excel Worksheet Functions 1 June 26th 05 03:00 AM
referencing a sheet named in a cell then using data from that sheet gbeard Excel Worksheet Functions 4 April 15th 05 08:42 AM
Excel VBA - VLookup problem referencing another sheet in the same workbook StylinEric Excel Programming 7 May 18th 04 01:21 PM


All times are GMT +1. The time now is 03:26 PM.

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

About Us

"It's about Microsoft Excel"