View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default Dynamic External Workbook reference

Hi Brian

I'm sorry I wasn't thinking clearly when I posted you a solution yesterday.
In a cell on your Sheet, let's say A1 enter
=TEXT(TODAY(),"yymmdd")&"[Cost Centre 1.xls]Sheet1"
This assumes the data for the lookup table is on Sheet1, amend accordingly.
Then change your formula to
=VLOOKUP(C3,INDIRECT(" ' "&A1&" '!$D:$F"),3,FALSE)

I have deliberately spaced out the " ' " to show the single quote enclosed
between the double quotes.

Regards

Roger Govier


Co-op Bank wrote:
I have the following formula, its referencing an external workbook:-
=VLOOKUP(C3,'051206Cost Centre 1 .xls'!$D:$F,3,FALSE), the problem is the
prefix to the external workbook is a date and this changes every day (i.e.
the '051206' bit of the formula is the current day in yymmdd format).

Is there any way I type in a single formula that will dynamically refer to
the current days spreadsheet? I have tried the following but it returns an
error: - =VLOOKUP(C3,"'"&TEXT(TODAY(),"yymmdd")&"Cost Centre 1
.xls'!"&$D:$F,3,FALSE)

Any suggestions much appreciated.

Thanks

Brian
Co-op Bank
Manchester, England