+ Reply to Thread
Results 1 to 3 of 3

Indirectly referencing a worksheet within a formula

  1. #1
    Registered User
    Join Date
    07-26-2012
    Location
    Missouri
    MS-Off Ver
    Excel 2007
    Posts
    2

    Indirectly referencing a worksheet within a formula

    I've been struggling with these for a while, here are the details.

    I have a formula in worksheet "March" that uses data from worksheet "Family" (all in the same workbook). In order to reference the data, I use the following formula:

    =SUMIF(Family!B$2:BA$2,MONTH(A$1),Family!B$22:BA$22)

    The row that this data is in is named "Family", to correspond with the worksheet it is talking about. However, in the formula (as you can see), I had to type out "Family!" to get the reference I wanted.

    What I want to be able to do is to get the formula to automatically detect what the row title is, understand that it is referencing a different worksheet, and automatically update the formula with that worksheet.

    The XXX marks the part of the formula I want to do the work:

    =SUMIF(XXXB$2:BA$2,MONTH(A$1),Family!B$22:BA$22)


    The reason I want this is so that if I have a new workbook, "Friends", I want to be able to type "Friends" as the row heading and have any data I drag down automatically reference "Friends" (instead of "Family").

    I have tried using the INDIRECT function with little success. Any help would be appreciated!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Indirectly referencing a worksheet within a formula

    So, is "Family" (or "Friends") in A2? If so you could change your formula to this:

    =SUMIF(INDIRECT("'"&$A2&"'!B2:BA2"),MONTH(A$1),INDIRECT("'"&$A2&"'!B22:BA22"))

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    07-26-2012
    Location
    Missouri
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Indirectly referencing a worksheet within a formula

    This was perfect, thank you so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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