+ Reply to Thread
Results 1 to 4 of 4

Non-volatile replacement for INDIRECT in SUMIFS formula

  1. #1
    Registered User
    Join Date
    07-06-2012
    Location
    Danvers, MA
    MS-Off Ver
    Excel 2010
    Posts
    19

    Non-volatile replacement for INDIRECT in SUMIFS formula

    Okay so I'm trying to us the SUMIFS formula to add values on a different sheet based on criteria on that sheet but I want to use a text string on the sheet with the SUMIFS formula to reference the sheet with the data on it.

    My original formula was:

    =SUMIFS(INDIRECT("'"&A2&"'!K4:K500"),INDIRECT("'"&$A$2&"'!B4:B500"),"=LEFT(AA1,2)",LEFT(INDIRECT("'"&$A$2&"'!C4:C500"),3),"=MID(AA1,7,3)")

    However I kept getting an error and excel said that INDIRECT("'"&A2&"'!K4:K500") was volatile, so I tried to replace it with INDEX and my formula was:

    =SUMIFS(INDEX(A2:A2,1)&"'!K4:K500",INDEX(A2:A2,1)&"'!B4:B500",LEFT(AA1,2),LEFT(INDEX(A2:A2,1)&"'!C5:C500",3),MID(AA1,7,3))

    However INDEX(A2:A2,1)&"'!K4:K500" returns the value "1251062 EP.EL+CB-A10'!K4:K500" which wont calculate properly because of the quotation marks but excel is auto inserting them.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Non-volatile replacement for INDIRECT in SUMIFS formula

    Sorry, you can only use indirect to vary the sheetname in a formula from a cell.

    The only other option would be some VBA Event code to change the sheetname in the formula when you change the value of A2.


    But I believe I see what the problems are in that formula...

    You don't need quotes around the LEFT and MID functions to be used as criteria of the ranges.
    And you can't use LEFT on the 2nd CriteriaRange (instead, use a wildcard on the criteria)

    Try
    =SUMIFS(INDIRECT("'"&A2&"'!K4:K500"),INDIRECT("'"&$A$2&"'!B4:B500"),LEFT(AA1,2),INDIRECT("'"&$A$2&"'!C4:C500"),MID(AA1,7,3)&"*")
    Last edited by Jonmo1; 12-04-2013 at 10:54 AM.

  3. #3
    Registered User
    Join Date
    07-06-2012
    Location
    Danvers, MA
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Non-volatile replacement for INDIRECT in SUMIFS formula

    Oh that is a bummer.

    Thank you though that does fix the code and it works now.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Non-volatile replacement for INDIRECT in SUMIFS formula

    You're welcome.

+ 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. Volatile INDIRECT
    By wjsok85 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-23-2010, 07:53 AM
  2. Replacement for using Indirect (Volatile)
    By jeffreybrown in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-31-2009, 09:54 AM
  3. Replies: 2
    Last Post: 04-25-2009, 06:36 AM
  4. Replies: 3
    Last Post: 03-27-2009, 11:29 PM
  5. is there a NON-volatile version of INDIRECT ??
    By spiderman in forum Excel General
    Replies: 1
    Last Post: 02-04-2005, 01:06 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