+ Reply to Thread
Results 1 to 7 of 7

Cannot get INDIRECT function to work with SUMIFS

  1. #1
    Forum Contributor
    Join Date
    09-05-2009
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    156

    Question Cannot get INDIRECT function to work with SUMIFS

    Hi All, as you can see from the attached example, I am trying to have a formula that takes a sheet name from a cell in my summary sheet to pull information from the named sheet in the same workbook. I have tried a combination of the INDIRECT and SUMIF functions but I cannot get it to work. Also, rather simply, to transpose the totals in column F into a row contained within a table summary. I can of course copy and transpose the values but that would be too time consuming. I have very many sheets to summarise so any help appreciated! Apologies if this should be two separate posts – I’m sure someone will tell me if so!
    Attached Files Attached Files
    Last edited by kborgers; 11-22-2012 at 07:55 AM. Reason: Error in title

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

    Re: Cannot get INDIRECT function to work with SUMIF

    Instead of trying to transpose the totals, you can work them out directly by putting this formula in I2:

    =SUMIF(INDIRECT("'"&$H2&"'!A:A"),I$1,INDIRECT("'"&$H2&"'!D:D"))

    Then you can copy this across to Q2, and then copy I2:Q2 down (when you have Sheet 2 and the others in place).

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    09-05-2009
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    156

    Re: Cannot get INDIRECT function to work with SUMIF

    Hey Pete, that's great - thanks! It works brilliantly. I now notice by the way that my original description was wrong - I'm trying to get SUMIFS to work with INDIRECT, not SUMIF - I'll correct this now. So, the second part of my problem is resolved but not the first. I applied the syntax you suggested to my SUMIFS formula but still get an error message.

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

    Re: Cannot get INDIRECT function to work with SUMIF

    Okay, see the attached file. I've copied Sheet 1 and called it Sheet 2, and the formulae in the sub-table for Sheet 1 can be copied to the other sub-tables, as long as you have sheets with the names in the top corner of the sub-table. See my notes in blue.

    Hope this helps.

    Pete
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-05-2009
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    156

    Re: Cannot get INDIRECT function to work with SUMIFS

    Pete; just fantastic! You're are an absolute star! Many thanks!!

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

    Re: Cannot get INDIRECT function to work with SUMIFS

    Thanks for feeding back. The "trick" in this is that I set up the formulae in the top line of the table for Sheet 1 using the reference $A$2, so when I copied the formulae down to the bottom of the table the references did not change. I then highlighted the 4 columns of formulae and did Find&Replace to change $A$2 to A2, so that all cells were now referenced relatively to the sheet name in A2. This then allows you to copy the whole block down into a new area, and the formulae will reference whatever sheet name is in that upper left corner of the table.

    Pete

  7. #7
    Forum Contributor
    Join Date
    09-05-2009
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    156

    Re: Cannot get INDIRECT function to work with SUMIFS

    That's a really neat trick Pete - thanks again.

    Kevin.

+ 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