Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How To make a sheet reference Variable (eq: sum(sheet!D2:H2))

I cant seem to find a way to change a cell reference without using IF
statements.

For example, Id like to change the target worksheet the SUM formula
references depending on the value of a certain cell.

An example of a formula I would like to use is

=SUM(€˜A3!D2:H2)

Where as A3 equals the name of a certain employee. So then the formula would
go to that employee's specific worksheet and reference D2:H2.

Problem is excel doesnt allow things to be so simple from what I gather€¦ so
I end up with a formula like this:

=IF($A3="Christian",SUM(Christian!$D$2:$H$2),IF($A 3="Muniz",SUM(Muniz!$D$2:$H$2),IF($A3="Natal",SUM( Natal!$D$2:$H$2),IF($A3="Quigley",SUM(Quigley!$D$2 :$H$2),IF($A3="Washington",SUM(Washington!$D$2:$H$ 2))))))

I even tried to use the concatenate forumal to work around my issue, but it
didnt work (haha)

=CONCATENATE("=sum(",A3,"!","D2:H2)") becomes =sum(Christian!D2:H2) but as a
text only value


Does anyone know of a way to make the first formula to work the way I want
it to?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default How To make a sheet reference Variable (eq: sum(sheet!D2:H2))

INDIRECT() can help you:

I cell A3 contains:
Ravenswood
and this is the name of a worksheet, then:

=SUM(INDIRECT(A3 & "!D2:H2"))

will give you the same as

=SUM(Ravenswood!D2:H2)


--
Gary''s Student - gsnu200792


"John Linker" wrote:

I cant seem to find a way to change a cell reference without using IF
statements.

For example, Id like to change the target worksheet the SUM formula
references depending on the value of a certain cell.

An example of a formula I would like to use is

=SUM(€˜A3!D2:H2)

Where as A3 equals the name of a certain employee. So then the formula would
go to that employee's specific worksheet and reference D2:H2.

Problem is excel doesnt allow things to be so simple from what I gather€¦ so
I end up with a formula like this:

=IF($A3="Christian",SUM(Christian!$D$2:$H$2),IF($A 3="Muniz",SUM(Muniz!$D$2:$H$2),IF($A3="Natal",SUM( Natal!$D$2:$H$2),IF($A3="Quigley",SUM(Quigley!$D$2 :$H$2),IF($A3="Washington",SUM(Washington!$D$2:$H$ 2))))))

I even tried to use the concatenate forumal to work around my issue, but it
didnt work (haha)

=CONCATENATE("=sum(",A3,"!","D2:H2)") becomes =sum(Christian!D2:H2) but as a
text only value


Does anyone know of a way to make the first formula to work the way I want
it to?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How To make a sheet reference Variable (eq: sum(sheet!D2:H2))

Thanks for the quick reply. I actually tried the Indirect formula once but I
didnt format it correctly apparently :) Thanks for the example.

"Gary''s Student" wrote:

INDIRECT() can help you:

I cell A3 contains:
Ravenswood
and this is the name of a worksheet, then:

=SUM(INDIRECT(A3 & "!D2:H2"))

will give you the same as

=SUM(Ravenswood!D2:H2)


--
Gary''s Student - gsnu200792


"John Linker" wrote:

I cant seem to find a way to change a cell reference without using IF
statements.

For example, Id like to change the target worksheet the SUM formula
references depending on the value of a certain cell.

An example of a formula I would like to use is

=SUM(€˜A3!D2:H2)

Where as A3 equals the name of a certain employee. So then the formula would
go to that employee's specific worksheet and reference D2:H2.

Problem is excel doesnt allow things to be so simple from what I gather€¦ so
I end up with a formula like this:

=IF($A3="Christian",SUM(Christian!$D$2:$H$2),IF($A 3="Muniz",SUM(Muniz!$D$2:$H$2),IF($A3="Natal",SUM( Natal!$D$2:$H$2),IF($A3="Quigley",SUM(Quigley!$D$2 :$H$2),IF($A3="Washington",SUM(Washington!$D$2:$H$ 2))))))

I even tried to use the concatenate forumal to work around my issue, but it
didnt work (haha)

=CONCATENATE("=sum(",A3,"!","D2:H2)") becomes =sum(Christian!D2:H2) but as a
text only value


Does anyone know of a way to make the first formula to work the way I want
it to?

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
Excel worksheet - Can I make changes in one sheet affect contents of other sheet? [email protected] Excel Discussion (Misc queries) 3 July 11th 06 03:34 PM
How can I make the names for Sheet tabs a reference to a cell? PDS Excel Discussion (Misc queries) 2 May 5th 06 11:20 PM
Variable sheet and Formula Sheet Emmett423 Excel Discussion (Misc queries) 2 March 31st 06 02:14 AM
How do I make a cell reference to a sheet title name trtfn Excel Discussion (Misc queries) 2 January 26th 06 06:38 PM
Cell reference - for the sheet name, can I use a variable? Matt Lawson Excel Discussion (Misc queries) 4 December 13th 04 02:31 PM


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