+ Reply to Thread
Results 1 to 11 of 11

Indirect and substitute formua with sumifs

  1. #1
    Registered User
    Join Date
    08-15-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Indirect and substitute formua with sumifs

    Hello,

    I'm wondering if anyone can help me with a formula that will allow me to use information from 3 data validation lists to calculate the sum of values between 2 dates in a specific worksheet and column.

    I have attached a copy of my test spreadsheet as it is difficult to explain. The formula I'm having trouble with is in the total cell 'E14'.

    My formula so far is:

    =(SUMIFS(INDIRECT("'"&$E$4&"'!$B:$B"),INDIRECT("'"&$E$4&"'!$A:$A"),">="&$H$7,INDIRECT("'"&$E$4&"'!$A:$A"),"<="&$H$10))

    Basically, the part I need help with is replacing !$B:B with a named range that will return data from the correct worksheet and column.

    Thanks in advance for your help,

    Emily
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Indirect and substitute formua with sumifs

    Hi EmilyB,

    It looks like you want to wrap 3 or more sheets up into a single table and then get an answer from them.

    Read this: http://www.pivot-table.com/2010/07/1...in-excel-2007/

    I've added this PT Wizard to the QAT (Quick Access Toolbar) and done your problem in a little different way. See if it works for you.
    BTW - You can sort and filter your Pivot in lots of ways. That is what it looks like you're trying to do.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Indirect and substitute formua with sumifs

    I didn't look at your file (too big!).

    If the named range is defined using functions like OFFSET then it won't work within the INDIRECT function.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    08-15-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Indirect and substitute formua with sumifs

    Marvin - Thanks for your suggestion. However I'm not sure that the pivot option will work as the spreadsheet will be used by people with very limited computer skills. The yearly lists will also contain a heap more data (water consumption recorded at 5 minute intervals for the entire year for each site. Additionally, once I get the basic formula sorted I'll also be extrapolating it out to display average, min and max values from the range selected. I'll explore the pivot a little more just in case I can make it usable for them.

    Tony - Thanks also for your help. I haven't used any functions within the named range (that I'm aware of). All I did was highlight the cells and apply a name to it.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Indirect and substitute formua with sumifs

    Quote Originally Posted by EmilyB View Post

    =(SUMIFS(INDIRECT("'"&$E$4&"'!$B:$B"),INDIRECT("'"&$E$4&"'!$A:$A"),">="&$H$7,INDIRECT("'"&$E$4&"'!$A:$A"),"<="&$H$10))

    Basically, the part I need help with is replacing !$B:B with a named range that will return data from the correct worksheet and column.
    I haven't used any functions within the named range
    OK, is the named range on the same sheet that is being referenced in cell E4?

    Note that the size of the named range must be the same size as all the other ranges.

  6. #6
    Registered User
    Join Date
    08-15-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Indirect and substitute formua with sumifs

    Hi Tony,

    Yes, the named range is on the sheet referenced in cell E4.

    Just with your second note - does this mean named ranges in the worksheet I'm trying to get the formula to read from or include all lists I created for the drop-downs too?

    Thanks,

    Emily

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Indirect and substitute formua with sumifs

    Can you post a SMALL sample file that demonstrates what you're wanting to do?

    A SMALL sample file is about 20 rows worth of data.

  8. #8
    Registered User
    Join Date
    08-15-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Indirect and substitute formua with sumifs

    Hi Tony,

    I've attached another file. I'm not entirely sure why it is so big as I've only got 4 worksheets with about 4 rows of data in each.

    Thanks,
    Emily
    Attached Files Attached Files

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Indirect and substitute formua with sumifs

    Quote Originally Posted by EmilyB View Post
    Hi Tony,

    I've attached another file. I'm not entirely sure why it is so big as I've only got 4 worksheets with about 4 rows of data in each.
    On the 2012 and 2013 sheets there is data in column B in the range B2931:B8929.

    I deleted that data and reset the used range then the file size shrunk down to a nice 25kb!

    Ok, I think this is what you need:

    =SUMIFS(INDIRECT(H4&E4),INDIRECT("'"&E4&"'!A2:A4"),">="&$H$7,INDIRECT("'"&E4&"'!A2:A4"),"<="&$H$10)

    You have to remember to make sure all the named ranges are the same size. It might be easier to just define the ranges to refer to the entire columns.

  10. #10
    Registered User
    Join Date
    08-15-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Thumbs up Re: Indirect and substitute formua with sumifs

    Hi Tony,

    Thanks so much for your persistence - your solution is perfect!

    Sorry about the extra data I missed. Nice pick up on your part.

    Thanks again,

    Emily

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Indirect and substitute formua with sumifs

    You're welcome. Thanks for the feedback!

+ 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. Substitute for INDIRECT with closed files
    By Jumbala in forum Excel General
    Replies: 19
    Last Post: 03-25-2010, 03:56 PM
  2. Indirect/Substitute combobox to populate graph
    By PRodgers in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 09-02-2009, 04:30 AM
  3. Indirect substitute problem
    By RooTFantastic in forum Excel General
    Replies: 1
    Last Post: 02-17-2009, 06:10 PM
  4. indirect / substitute questions
    By RooTFantastic in forum Excel General
    Replies: 1
    Last Post: 02-17-2009, 03:03 PM
  5. Indirect/Substitute in sums
    By nrage21 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-20-2008, 11:48 AM

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