+ Reply to Thread
Results 1 to 4 of 4

SUMPRODUCT(SUMIF(INDIRECT with Dynamic Worksheet Range

  1. #1
    Registered User
    Join Date
    10-06-2010
    Location
    Perth
    MS-Off Ver
    Excel 2007
    Posts
    9

    SUMPRODUCT(SUMIF(INDIRECT with Dynamic Worksheet Range

    Hi,

    I am trying to improve a formula so it doesn't need to be edited every time a new worksheet is added. Ive searched around but the examples listed dont seem to fit my current predicament.

    The current formula looks like the below (An example of one cell);
    =SUMPRODUCT(SUMIF(INDIRECT($M$4:$M$11&"!A:A"),$B6,INDIRECT($M$4:$M$11&"!N:N")))

    With the range M4 to M11 containing all the worksheet names.

    However I wanted to substitute M11 for something else such as "$M"&$M$2 with cell M2 containing a simple formula (=COUNTA(M4:M50)+3) which will work out how many tabs are in use. This way when they add a worksheet they simply add it to the list and the formula would automatically include the new worksheet without manually amending the $M$11 in the formula (Done via Find and Replace because its used multiple times)

    However I cant seem to get anything to work. I have tried embedding a second indirect, using concatenate and just amending the original formula but all end with the #Ref error. Anyone know a solution that could help me out?

    Some examples Ive tried unsuccessfully

    =SUMPRODUCT(SUMIF(INDIRECT("$M$4:$M$"&$M$2&"!A:A"),$B7,INDIRECT("$M$4:$M$"&$M$2&"!N:N")))
    =SUMPRODUCT(SUMIF(INDIRECT($M$4&":$M$"&$M$2&"!A:A"),$B7,INDIRECT($M$4&":$M$"&$M$2&"!N:N")))

    I kind of understand why it doesn't work, it needs a link to the worksheet name however by breaking apart the cell its losing that direct link.

    Cheers,

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: SUMPRODUCT(SUMIF(INDIRECT with Dynamic Worksheet Range

    My first choice would be using an Excel Table where I fill in the sheet names. The Table feature will provide you with a dynamic named range and then you use this name in the formula.
    http://www.jkp-ads.com/articles/Excel2007tables.asp

    My second option would be a dynamic named range.
    http://www.contextures.com/xlNames01.html#Dynamic
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Registered User
    Join Date
    10-06-2010
    Location
    Perth
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: SUMPRODUCT(SUMIF(INDIRECT with Dynamic Worksheet Range

    Mint,

    Dynamic Named Range with offset worked a charm!

    Thanks for your assistance.

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: SUMPRODUCT(SUMIF(INDIRECT with Dynamic Worksheet Range

    Glad to hear it works!

+ 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: 3
    Last Post: 06-19-2014, 10:30 AM
  2. Replies: 15
    Last Post: 09-10-2013, 05:31 AM
  3. [SOLVED] Excel Novice - attempting to use SUMPRODUCT/SUMIF/INDIRECT but cell shows #REF
    By mbasi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-17-2013, 05:44 AM
  4. Replies: 0
    Last Post: 08-17-2012, 02:02 PM
  5. Sumproduct(sumif(indirect
    By jmcgallan in forum Excel General
    Replies: 6
    Last Post: 09-17-2010, 12:03 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