+ Reply to Thread
Results 1 to 9 of 9

SUMIF vs SUMPRODUCT

  1. #1
    Registered User
    Join Date
    02-14-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2007
    Posts
    50

    SUMIF vs SUMPRODUCT

    Hi I am new here. My name is John and I am starting to have to use excel 2007 more at work. I am currently trying to add values from two different workbooks into a third excel sheet. I tried using this equation: =SUMIF('[Wk07_CA5127_Cost Planning.xlsx]December 2010'!$D$7:$D$1000,$A24,'[Wk07_CA5127_Cost Planning.xlsx]December 2010'!G$108:G$278)+SUMIF('[Wk07_CA5258_Cost Planning.xlsx]December 2010'!$D$7:$D$1000,$A24,'[Wk07_CA5258_Cost Planning.xlsx]December 2010'!G$108:G$278).

    This equation worked well but I noticed as soon as I closed the workbooks it turned from a numerical value to #VALUE. I have been doing some research on the SUMPRODUCT function but am confused how I would translate the above formula into the SUMPRODUCT formula. Can anyone help me out?

    Thanks
    Johnny

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: SUMIF vs SUMPRODUCT

    Hello John, Please don't post the same question in multiple forums - I'm deleting your other questions.....
    Audere est facere

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: SUMIF vs SUMPRODUCT

    OK, I didn't delete them, shg locked your other posts.....

    A SUMIF of this form

    =SUMIF(A1:A10,C1,B1:B10)

    can be written as a SUMPRODUCT of this form

    =SUMPRODUCT((A1:A10=C1)+0,B1:B10)

  4. #4
    Registered User
    Join Date
    02-14-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: SUMIF vs SUMPRODUCT

    Sorry about that I was unsure where to post it. I will not do that again my bad

  5. #5
    Registered User
    Join Date
    02-14-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: SUMIF vs SUMPRODUCT

    Okay I tried that and still got #VALUE. Does something look wrong with this equation?

    =SUMPRODUCT(('[Wk07_CA5127_Cost Planning.xlsx]December 2010'!$D$7:$D$56=A37)+0,'[Wk07_CA5127_Cost Planning.xlsx]December 2010'!$G$108:$G$278)+SUMPRODUCT(('[Wk07_CA5258_Cost Planning.xlsx]December 2010'!$D$7:$D$56=A37)+0,'[Wk07_CA5258_Cost Planning.xlsx]December 2010'!$G$108:$G$278)

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: SUMIF vs SUMPRODUCT

    You have mismatched ranges, the first range is 50 rows ($D$7:$D$56) the second is 171 ($G$108:$G$278), they need to be the same size, normally I'd expect the ranges to start on the same row too, don't you want to sum numbers on a row if the criterion is met on the same row?

    Your SUMIF has the same problem but SUMIF won't give you an error, it will just adjust the sum range to be the same size as the criteria range (which might not actually give you the result you expect)

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: SUMIF vs SUMPRODUCT

    The two ranges have to be the same size. The first is 50 rows and the second is 171.

    Please Login or Register  to view this content.
    Also, you are (or would be) computing the same value twice.
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Registered User
    Join Date
    02-14-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: SUMIF vs SUMPRODUCT

    Thanks for your responses. No they are the same cells but two different work books so they wouldn't be the same exact thing twice. I am going to try your formula now and hopefully this will work haha

  9. #9
    Registered User
    Join Date
    02-14-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: SUMIF vs SUMPRODUCT

    It worked great thanks for all the help

+ 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