ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Vlookup in book which will change. (https://www.excelbanter.com/excel-programming/293338-vlookup-book-will-change.html)

Beto[_3_]

Vlookup in book which will change.
 
Hi,
I'm creating a template to search in a price list in a closed book, this
book will change its name every week, so I want to put the name of the
book in a cell and use this name as an argument in a vlookup function.
Is this feasible?

Ex:
A1 - PriceList0.xls

C10 - =VLOOKUP(B10,'P:\PRICES\[PriceList0.xls]Products'!$A$2:$B$10,2,0)

Now in C10 I'd like to change the formula to use the value in A1.

Any suggestions?

Regards,
--
Beto

Frank Kabel

Vlookup in book which will change.
 
Hi Beto
if your other workbook is OPEN you may try the following
=VLOOKUP(B10,INDIRECT("'[" & A1 & "]Products'!$A$2:$B$10"),2,0)
This won't work if the other workbook is closed.


You may also have a look at the following thread (describing further
alternatives for accessing closed workbooks): http://tinyurl.com/2c62u

--
Regards
Frank Kabel
Frankfurt, Germany

Beto wrote:
Hi,
I'm creating a template to search in a price list in a closed book,
this book will change its name every week, so I want to put the name
of the book in a cell and use this name as an argument in a vlookup
function. Is this feasible?

Ex:
A1 - PriceList0.xls

C10 -
=VLOOKUP(B10,'P:\PRICES\[PriceList0.xls]Products'!$A$2:$B$10,2,0)

Now in C10 I'd like to change the formula to use the value in A1.

Any suggestions?

Regards,


L. Howard Kittle[_2_]

Vlookup in book which will change.
 
Hi Beto,

I was able to set that up doing the following. There may a neater way but I
believe this will work for you. An expmple to show the process, you will
need to adapt your cells etc.

A1 = [
A2 = "PriceList" (no quotes)
A3 = 10 (or whatever PlricList number)
A4 = ]
A5 = =A1&A2&A3&A4
C1 = The vlookup value
C2 = A5&"Sheet1!$A$1:$B$5" (with quotes)
F2 = =IF(ISNA(VLOOKUP(C1,INDIRECT(C2),2,0)),"",
VLOOKUP(C1,INDIRECT(C2),2,0))

Two workbooks named and saved as PriceList0 and PriceList10 with the lookup
tables in A1:B5. This is to simulate the workbook name changes.

Change A3 to either 10 or 0 and enter the lookup values in C1.
So if the new workbook is always PriceList and some number, all you have to
do is change the number in A3 for the formula to lookup in the new book

HTH
Regards,
Howard
"Beto" wrote in message
...
Hi,
I'm creating a template to search in a price list in a closed book, this
book will change its name every week, so I want to put the name of the
book in a cell and use this name as an argument in a vlookup function.
Is this feasible?

Ex:
A1 - PriceList0.xls

C10 - =VLOOKUP(B10,'P:\PRICES\[PriceList0.xls]Products'!$A$2:$B$10,2,0)

Now in C10 I'd like to change the formula to use the value in A1.

Any suggestions?

Regards,
--
Beto




Beto[_3_]

Vlookup in book which will change.
 
Thanks to both for your implementations and suggestions, I haven't tried
them yet, but I'm sure it will point me in the right direction.

Regards,
--
Beto


All times are GMT +1. The time now is 07:14 AM.

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