+ Reply to Thread
Results 1 to 4 of 4

Reference Other Sheet Through Variable

  1. #1
    Registered User
    Join Date
    12-09-2016
    Location
    Charlotte, NC
    MS-Off Ver
    2013
    Posts
    32

    Reference Other Sheet Through Variable

    All,

    Apologies for not using the proper syntax to describe my problem, I'm "self taught" (aka Google and trial and error). However this problem is stumping me.

    I created the formula below to reference another worksheet.

    =IF(SUMIFS('12.6'!$G$1:$G$2000,'12.6'!$F$1:$F$2000,$B$2,'12.6'!$E$1:$E$2000,$A4)=0,"",SUMIFS('12.6'!$G$1:$G$2000,'12.6'!$F$1:$F$2000,$B$2,'12.6'!$E$1:$E$2000,$A4))

    While it may not be the most efficient approach, it does work.

    My goal is to replace "12.6" with a variable so that I can update the formula on new sheets more quickly. For instance in the formula above there are 6 instances of '12.6'. I would love to have the ability to update one cell to say '12.9' and have the formula call on that cell to change all 6 instances.

    Any guidance here would be great. Thanks!

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Reference Other Sheet Through Variable

    You can use INDIRECT. If not

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Reference Other Sheet Through Variable

    To use INDIRECT as suggested, let's say Z1 contains the sheet name
    =IF(SUMIFS(INDIRECT("'"&$Z$1&"'!$G$1:$G$2000"),INDIRECT("'"&$Z$1&"'!$F$1:$F$2000"),$B$2,INDIRECT("'"&$Z$1&"'!$E$1:$E$2000"),$A4)=0,"",SUMIFS(INDIRECT("'"&$Z$1&"'!$G$1:$G$2000"),INDIRECT("'"&$Z$1&"'!$F$1:$F$2000"),$B$2,INDIRECT("'"&$Z$1&"'!$E$1:$E$2000"),$A4))

    Note that it will make all the formulas that use it volatile and if you have a lot of them it will slow your sheet down a lot. In my opinion, using Find/Replace is preferable.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Registered User
    Join Date
    12-09-2016
    Location
    Charlotte, NC
    MS-Off Ver
    2013
    Posts
    32

    Re: Reference Other Sheet Through Variable

    Thanks for the advice.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 05-06-2013, 05:20 PM
  2. cell reference from one sheet to other sheet use variable
    By hassan1960 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-04-2013, 07:37 PM
  3. External reference with variable sheet name
    By mrossman04 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-26-2012, 04:43 PM
  4. variable sheet reference
    By aosnatca in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-19-2010, 03:10 PM
  5. use a cell/variable as a sheet reference?
    By 222fbj in forum Excel General
    Replies: 9
    Last Post: 01-11-2010, 05:19 PM
  6. Variable Sheet Reference
    By telton in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-29-2007, 02:02 AM
  7. reference a sheet with variable?
    By pgag45 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2007, 04:08 PM
  8. Reference Variable Sheet in macro
    By LaraBee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2007, 03:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1