+ Reply to Thread
Results 1 to 7 of 7

sumif/sumproduct

  1. #1
    Registered User
    Join Date
    07-07-2007
    Posts
    14

    Question sumif/sumproduct

    I would like to add up the numbers in a column (ee) if there is a 1 entered in two other columns (L and FP). I know that sumif will not work for this, but I cannot get another formula to work. So far I have:

    =SUMPRODUCT(($L$5:$L$1818="1")*($FP$5:$FP$1818="1")*EE5:EE1818)

    I do not know what function to use here. Sumproduct came up on the searches I did on previous posts but I cannot get it to work right. In any case I am trying to add, not multiply... Any help on this would be appreciated.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi Katie,

    Your formula looks pretty close, but could use a little tweaking. First, are the 1's in your two columns (L and FP) entered as text or as numbers? If they're text, then you've done that part correctly by putting the 1's in quotes. If not, leave the quotes off. Also, the last section also needs to be within parenthesis.

    Try this slightly modified formula:
    Please Login or Register  to view this content.
    If your 1's are text, then try this one instead:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Quote Originally Posted by pjoaquin
    Also, the last section also needs to be within parenthesis.
    Not really, this formula should work perfectly well

    =SUMPRODUCT(($L$5:$L$1818=1)*($FP$5:$FP$1818=1), EE5:EE1818)

  4. #4
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    I must be missing something - why doesn't this work too?:

    =SUMPRODUCT(($L$5:$L$1818=1)*($FP$5:$FP$1818=1)*EE5:EE1818)

    Richard

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Yes, Richard, it does. I wasn't trying to imply that you needed to use , instead of * to exclude the parentheses.

    Of course those two formulas could give you a different result. If there's any text in the range EE5:EE1818 then the latter will fail (i.e. give a #VALUE! error) whereas the first won't.

    I'm never quite sure if that's good or bad. You could argue that it's better to get an error to alert you to text in the sum range rather than get an actual figure which might be incorrect because you have text in the sum range......

  6. #6
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Thanks for the clarification

  7. #7
    Registered User
    Join Date
    07-07-2007
    Posts
    14
    Thank you so much for 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