Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default insert a variable into a formula


I would like to substitute the following formula (below) that has the "2006"
in the worksheet reference with either a variable name or a cell reference.
Below I have tried to explain this.

=SUM('[Jennifer PTO 2006.xls]Randy'!$C$100)
Explanation: This is the actually formula that I am trying to change, and
this one works. From the worksheet called Jennifer PTO 2006, I am using cell
reference C100 and carring that value over to another worksheet.

I would like to create a variable name for 2006, so that by changing the
value of a cell to 2007 the 2006 is replaced within the formula €“OR- just use
a cell reference to change this as well.

Something like: Refer to the sum(c4) in the first example or the
"carry_over" for the example 2.

=SUM('[Jennifer PTO, sum(c4).xls]Randy'!$C$100) -- where cell c4 has the
value of 2007

OR

=SUM('[Jennifer PTO, €ścarry_over€ť.xls]Randy'!$C$100) €“ where carry_over has
the value of 2007

I am getting a syntax error REF#, but cannot find any help on how to insert
a variable name within a formula.

Any help is much appreciated.

Thanks.

Randy


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default insert a variable into a formula

Hi Randy,

Look in HELP for the INDIRECT() function

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"pappy" wrote in message ...
|
| I would like to substitute the following formula (below) that has the "2006"
| in the worksheet reference with either a variable name or a cell reference.
| Below I have tried to explain this.
|
| =SUM('[Jennifer PTO 2006.xls]Randy'!$C$100)
| Explanation: This is the actually formula that I am trying to change, and
| this one works. From the worksheet called Jennifer PTO 2006, I am using cell
| reference C100 and carring that value over to another worksheet.
|
| I would like to create a variable name for 2006, so that by changing the
| value of a cell to 2007 the 2006 is replaced within the formula -OR- just use
| a cell reference to change this as well.
|
| Something like: Refer to the sum(c4) in the first example or the
| "carry_over" for the example 2.
|
| =SUM('[Jennifer PTO, sum(c4).xls]Randy'!$C$100) -- where cell c4 has the
| value of 2007
|
| OR
|
| =SUM('[Jennifer PTO, "carry_over".xls]Randy'!$C$100) - where carry_over has
| the value of 2007
|
| I am getting a syntax error REF#, but cannot find any help on how to insert
| a variable name within a formula.
|
| Any help is much appreciated.
|
| Thanks.
|
| Randy
|
|


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
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Insert New Row without shifting formula DJ Excel Worksheet Functions 2 September 26th 05 03:31 AM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 06:57 PM


All times are GMT +1. The time now is 01:25 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"