ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Referencing a sheet in VLOOKUP (https://www.excelbanter.com/excel-programming/348466-referencing-sheet-vlookup.html)

Max

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

Jim Thomlinson[_5_]

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


Dave Peterson

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

Tom Ogilvy

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





All times are GMT +1. The time now is 09:22 PM.

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