Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
len len is offline
external usenet poster
 
Posts: 53
Default Embedding the value of a cell in a formula

I would like to have the contents of a cell be part of a formula. For example:

In one cell I have the year: 2009

In the other a formula references another workbook: =C:/.../Ad Sales 2009!A1

I would like to be able to change the first cell to year 2010 and have the
formula automatically change with it to =C:/.../Ad Sales 2010!A1

Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Embedding the value of a cell in a formula

With the year in A2; try replacing the file name with the below
=INDIRECT("C:/.../Ad Sales " & A2 & "!A1")

If this post helps click Yes
---------------
Jacob Skaria


"Len" wrote:

I would like to have the contents of a cell be part of a formula. For example:

In one cell I have the year: 2009

In the other a formula references another workbook: =C:/.../Ad Sales 2009!A1

I would like to be able to change the first cell to year 2010 and have the
formula automatically change with it to =C:/.../Ad Sales 2010!A1

Is this possible?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Embedding the value of a cell in a formula

Yes, with the INDIRECT function. Let's say your year cell is B2. Formula then
becomes
=INDIRECT("C:/.../Ad Sales " & B2 & "!A1")

Note that you can join text and cells references together using the
ampersand. The spaces are not necessary, I just put them in there for clarity.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Len" wrote:

I would like to have the contents of a cell be part of a formula. For example:

In one cell I have the year: 2009

In the other a formula references another workbook: =C:/.../Ad Sales 2009!A1

I would like to be able to change the first cell to year 2010 and have the
formula automatically change with it to =C:/.../Ad Sales 2010!A1

Is this possible?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Embedding the value of a cell in a formula

Say we put the workbook name in H6 and in another cell:

=INDIRECT("'C:\test folder\[" & H6 & ".xls]Sheet2'!$F$3")

so if H6 contains 2009, the formula will return the value from 2009.xls

Note that we can specify sheet and cells as well. The limitation is that
the workbook specified in H6 must be open.
--
Gary''s Student - gsnu200857


"Len" wrote:

I would like to have the contents of a cell be part of a formula. For example:

In one cell I have the year: 2009

In the other a formula references another workbook: =C:/.../Ad Sales 2009!A1

I would like to be able to change the first cell to year 2010 and have the
formula automatically change with it to =C:/.../Ad Sales 2010!A1

Is this possible?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Embedding the value of a cell in a formula

Correction
A2 = 2009

=INDIRECT("'c:\[xlsfilename.xls]Ad Sales " & A2 &"'!A1")

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

With the year in A2; try replacing the file name with the below
=INDIRECT("C:/.../Ad Sales " & A2 & "!A1")

If this post helps click Yes
---------------
Jacob Skaria


"Len" wrote:

I would like to have the contents of a cell be part of a formula. For example:

In one cell I have the year: 2009

In the other a formula references another workbook: =C:/.../Ad Sales 2009!A1

I would like to be able to change the first cell to year 2010 and have the
formula automatically change with it to =C:/.../Ad Sales 2010!A1

Is this possible?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Embedding the value of a cell in a formula

The function you'd want to use that's built into excel is =indirect(). But that
function returns an error if the sending workbook is closed.

If that's a problem, then Laurent Longre has an addin (morefunc.xll) at:
http://xcell05.free.fr/
or
http://xcell05.free.fr/morefunc/english/index.htm

That includes =indirect.ext() that may help you.

Len wrote:

I would like to have the contents of a cell be part of a formula. For example:

In one cell I have the year: 2009

In the other a formula references another workbook: =C:/.../Ad Sales 2009!A1

I would like to be able to change the first cell to year 2010 and have the
formula automatically change with it to =C:/.../Ad Sales 2010!A1

Is this possible?


--

Dave Peterson
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
Embedding in a cell. ChattyKat Excel Discussion (Misc queries) 2 July 26th 07 09:10 AM
Embedding a macro within a formula rjhutch Excel Worksheet Functions 3 May 9th 06 01:29 AM
Embedding Word table in Excel cell Larry Lester New Users to Excel 3 October 24th 05 05:05 PM
Embedding a reference in a cell with normal text. Reggie Excel Worksheet Functions 2 March 18th 05 02:54 PM
Embedding file name in a Cell Mark Sowerbutts Links and Linking in Excel 2 January 5th 05 03:32 PM


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

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"