Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 791
Default Variable file reference

I am trying to use a date field in a column header to point to a file name to
pull data from and cannot get the formula to execute. Example:

B2 =10/2/08 B3=10/3/08 B4=10/4/08 ... etc....

formula in B3 = "=CONCATENATE("='Report
",MONTH(GL$3)&"-"&DAY(GL$3)&"-"&YEAR(GL$3),".xls'!Data"

where the report is stored as "Report 10-2-08.xls" and referencing the named
field "Data".

If I hard code the line the formula works and the Data appears in B3 but
the above line only shows the text in the cell and not the data referenced.

What am I doing wrong?

Thanks in advance for your efforts.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default Variable file reference

change YEAR(GL$3) to right(year(gl$3),2)




On Oct 7, 1:41*am, Michael wrote:
I am trying to use a date field in a column header to point to a file name to
pull data from and cannot get the formula to execute. *Example:

B2 =10/2/08 *B3=10/3/08 B4=10/4/08 ... etc....

formula in B3 = "=CONCATENATE("='Report
",MONTH(GL$3)&"-"&DAY(GL$3)&"-"&YEAR(GL$3),".xls'!Data"

where the report is stored as "Report 10-2-08.xls" and referencing the named
field "Data".

If I hard code the line the formula works and the Data appears in B3 but
the above line only shows the text in the cell and not the data referenced.

What am I doing wrong?

Thanks in advance for your efforts.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 791
Default Variable file reference

Okay, that fixed the year reference but the cell only displays the file name
and doesn't pull the value from the file. How do I get the cell to
execute the command to pull the data from the reference file?

Cell contents with the fix:
formula in B3 = "=CONCATENATE("='Report
",MONTH(B$3)&"-"&DAY(B$3)&"-"&RIGHT(YEAR(B$3),2),".xls'!Data"



"muddan madhu" wrote:

change YEAR(GL$3) to right(year(gl$3),2)




On Oct 7, 1:41 am, Michael wrote:
I am trying to use a date field in a column header to point to a file name to
pull data from and cannot get the formula to execute. Example:

B2 =10/2/08 B3=10/3/08 B4=10/4/08 ... etc....

formula in B3 = "=CONCATENATE("='Report
",MONTH(B$3)&"-"&DAY(B$3)&"-"&YEAR(B$3),".xls'!Data"

where the report is stored as "Report 10-2-08.xls" and referencing the named
field "Data".

If I hard code the line the formula works and the Data appears in B3 but
the above line only shows the text in the cell and not the data referenced.

What am I doing wrong?

Thanks in advance for your efforts.



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 linked file based on variable location reference Monk[_2_] Excel Discussion (Misc queries) 2 May 18th 08 10:47 AM
vba variable value via cell reference Bill (Unique as my name) Excel Discussion (Misc queries) 3 November 29th 06 12:40 AM
How to use variable in reference Ming Excel Worksheet Functions 2 July 27th 05 11:24 PM
Making a file and worksheet reference into a variable.... Mr Mike Excel Worksheet Functions 3 July 6th 05 08:52 PM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


All times are GMT +1. The time now is 10:50 AM.

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"