+ Reply to Thread
Results 1 to 7 of 7

Sumproduct(sumif(indirect

  1. #1
    Registered User
    Join Date
    03-24-2010
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    16

    Sumproduct(sumif(indirect

    Hello,

    I'm having issues using the SUMPRODUCT function in Excel.

    I am attempting to creat a summary sheet to calcualte total spends for different parts of the business.

    In this example i have my summary sheet with the business codes in Column A. In sheets 2 & 3 i have the spends against each code. Each code can apeear multiple time on both sheets. See attached

    On the summary page i have created a range for my tab names 'SheetList02' and am trying to use the following formula in cell D1...but unsucessfully

    =SUMPRODUCT(SUMIF(INDIRECT("'"SheetList02"'!A1:B7"),A9,INDIRECT("'"SheetList02"'!B1:B7")

    Can someone help?

    Many thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sumproduct(sumif(indirect

    In your example in D9, try

    =SUMPRODUCT(--(Sheet2!$A$2:$A$5=$A9)*INDEX(Sheet2!$B$2:$C$5,,MATCH(TEXT(D$7,"mmm"),Sheet2!$B$1:$C$1,0))) + SUMPRODUCT(--(Sheet3!$A$2:$A$5=$A9)*INDEX(Sheet3!$B$2:$C$5,,MATCH(TEXT(D$7,"mmm"),Sheet3!$B$1:$C$1,0)))

    That can be dragged across and down. Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sumproduct(sumif(indirect

    Based specifically on the sample posted

    Please Login or Register  to view this content.
    the above is however volatile (and inefficient) - used on large datasets or in large volume the impact of performance is likely to be noticeable.

  4. #4
    Registered User
    Join Date
    03-24-2010
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Sumproduct(sumif(indirect

    Quote Originally Posted by ChemistB View Post
    In your example in D9, try

    =SUMPRODUCT(--(Sheet2!$A$2:$A$5=$A9)*INDEX(Sheet2!$B$2:$C$5,,MATCH(TEXT(D$7,"mmm"),Sheet2!$B$1:$C$1,0))) + SUMPRODUCT(--(Sheet3!$A$2:$A$5=$A9)*INDEX(Sheet3!$B$2:$C$5,,MATCH(TEXT(D$7,"mmm"),Sheet3!$B$1:$C$1,0)))

    That can be dragged across and down. Does that work for you?
    Thanks, i tried it on the example and it work great. However i have tried to adapt it to my actual data and can't get it to work. I have pasted the formula into cell D69 and changed it to look at teh required cells etc. can you see where i am going wrong - see attached

    Many thanks
    Attached Files Attached Files

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sumproduct(sumif(indirect

    If you are not working 3D then use stand alone SUMIFs rather than SUMPRODUCT

    Please Login or Register  to view this content.
    Note re: original errors:

    a) your date headers are now dates on all sheets so MATCH is revised

    b) your 2nd SUMPRODUCT referenced 3:11 and 4:11

  6. #6
    Registered User
    Join Date
    03-24-2010
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Sumproduct(sumif(indirect

    Quote Originally Posted by DonkeyOte View Post
    If you are not working 3D then use stand alone SUMIFs rather than SUMPRODUCT

    Please Login or Register  to view this content.
    Note re: original errors:

    a) your date headers are now dates on all sheets so MATCH is revised

    b) your 2nd SUMPRODUCT referenced 3:11 and 4:11
    Thanks, this is all great. Works fine for my 1st 2 sheets but when i add more i just get a load of hashes. Not all sheets have got data in them yet but this shouldn't matter...correct?

    To add my additional sheets into the formula i assume that i can just copy the SUMIF and change the sheet names?

    Again, please see attached...
    Attached Files Attached Files

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sumproduct(sumif(indirect

    No need to quote the prior post in your reply - just clutters the thread.

    I just had a quick look at your file - you will get errors given on some of those sheets you're referencing there are no months listed (ie the MATCH of D7 fails).

    If this is a reality you should add pre-emptive tests to ensure the Month exists on the source sheet before conducting the SUMIF (with MATCH).

+ 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