+ Reply to Thread
Results 1 to 9 of 9

Sum Product with Multiple Conditions

  1. #1
    Registered User
    Join Date
    08-17-2011
    Location
    Chile
    MS-Off Ver
    Excel 2007
    Posts
    5

    Sum Product with Multiple Conditions

    Hello,

    I wish to calculate the sum product (quantity*price) of the following information:

    A B C D E
    1 When Sold Product Who Bought It Quantity Price
    2 Q3 11 tomatoes martha 8.694 19
    3 Q3 11 apples john 7.308 87
    4 Q3 11 tomatoes Martha 7.308 54
    5 Q3 11 tomatoes john 7.686 25
    6 Q3 11 apples Martha 3.654 26
    7 Q4 11 tomatoes martha 14.616 29
    8 Q4 11 apples john 3.906 47
    9 Q4 11 apples john 3.654 31
    10 Q4 11 tomatoes martha 7.308 42

    My problem apears when i want to classify the sum product given criteria as (when sold = Q3-11, product sold = tomatoes, person who bought it = martha).

    I have used the following formula but it does not calculate the sumproduct correctly:

    IF((COUNTIFS($C$2:$C$10,"="&"Martha",$A$2:$A$10,"="&"Q311",$B$2:$B$10,"="&"tomatoes")=0)," ",((SUMIFS($D$2:$D$10,$C$2:$C$10,"="&"Martha",$A$2:$A$10,"="&"Q311",$B$2:$B$10,"="&"tomatoes")*SUMIFS($E$2:$E$10,$C$2:$C$10,"="&"Martha",$A$2:$A$10,"="&"Q311",$B$2:$B$10,"="&"tomatoes"))/SUMIFS($D$2:$D$10,$C$2:$C$10,"="&"Martha",$A$2:$A$10,"="&"Q311",$B$2:$B$10,"="&"tomatoes"))/COUNTIFS($C$2:$C$10,"="&"Martha",$A$2:$A$10,"="&"Q311",$B$2:$B$10,"="&"tomatoes")) = 36,50

    When a normal sumproduct ((SUMPRODUCT(D2,E2)+SUMPRODUCT(D4,E4))/SUM(D2,D4)) would give me 34,98

    Can you please help with a formula whcih can calculate the sum product given multiple criteria

    Regards,

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Sum Product with Multiple Conditions

    Quote Originally Posted by mhordern View Post
    (when sold = Q3-11, product sold = tomatoes, person who bought it = martha).
    Instead of a formula, can you just tell us what the answer is for the criteria you state above and we'll go from there?
    Last edited by jeffreybrown; 08-17-2011 at 02:33 PM.
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    08-17-2011
    Location
    Chile
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum Product with Multiple Conditions

    For the criteria stated above it should look for sum product of prices and quatntiy for all tomatoes martha bought during Q3-11 = 34,98

  4. #4
    Registered User
    Join Date
    08-17-2011
    Location
    Chile
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum Product with Multiple Conditions

    to avoid confusion the formula is: (SUMIFS($D$2:$D$10,$C$2:$C$10,"="&"Martha",$A$2:$A$10,"="&"Q311",$B$2:$B$10,"="&"tomatoes")*SUMIF S($E$2:$E$10,$C$2:$C$10,"="&"Martha",$A$2:$A$10,"="&"Q311",$B$2:$B$10,"="&"tomatoes"))/SUMIFS($D$2:$D$10,$C$2:$C$10,"="&"Martha",$A$2:$A$10,"="&"Q311",$B$2:$B$10,"="&"tomatoes"))/COUNTIFS($C$2:$C$10,"="&"Martha",$A$2:$A$10,"="&"Q311",$B$2:$B$10,"="&"tomatoes")

  5. #5
    Registered User
    Join Date
    08-17-2011
    Location
    Chile
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum Product with Multiple Conditions

    given the criteria, i want to sum the multiplication of the quantity times the price and divide by the quantity.

  6. #6
    Registered User
    Join Date
    08-17-2011
    Location
    Chile
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum Product with Multiple Conditions

    the formula i have posted sums the quantities multipies by the sum of prices, divides by the sum of quantities and then i divid the whole thing by the criteria used (countif)... but this is wrong and i dont know an other way to have sum product with multple criteria....

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

    Re: Sum Product with Multiple Conditions

    In your example you show spaces between quarter and year like Q3 11......but you use Q311 (without space) in the formulas (and also mention Q3-11). Assuming Q311 is correct then try this formula

    =IFERROR(SUMPRODUCT((A2:A10="Q311")*(B2:B10="tomatoes")*(C2:C10="Martha"),D2:D10,E2:E10)/SUMIFS(D2:D10,A2:A10,"Q311",B2:B10,"tomatoes",C2:C10,"Martha"),"")
    Audere est facere

  8. #8
    Registered User
    Join Date
    11-02-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Sum Product with Multiple Conditions

    Quote Originally Posted by daddylonglegs View Post
    =IFERROR(SUMPRODUCT((A2:A10="Q311")*(B2:B10="tomatoes")*(C2:C10="Martha"),D2:D10,E2:E10)/SUMIFS(D2:D10,A2:A10,"Q311",B2:B10,"tomatoes",C2:C10,"Martha"),"")
    I am new to forums, but here it goes..... I have looked everywhere on how to use this formula. No matter what I do, replace commas with asteriks, visa versa, you name it, I've tried it. Here is my latest attempt and I don't see my issue:

    a c h i o
    group# ind# total Percent include Expected Answer
    11111 1 73 .95 Yes (73*.95)+(41*.98)/(73+41)
    11111 2 41 .98 Yes (73*.95)+(41*.98)/(73+41)
    11111 3 4 .10 No (73*.95)+(41*.98)/(73+41)
    22222 1 55 .55 Yes (55*.55)/(55)
    33333 1 No (60*1)/(60)
    33333 2 60 1 Yes (60*1)/(60)


    Here is my formula:
    =SUMPRODUCT(($A:$A=$A2)*(O:O="Yes"),H:H,I:I)/SUMIFS(H:H,A:A,A2,O:O,"Yes")

    I want to be able to include in the calculations only those that meet the criteria, but the answer needs to also show up for the individuals in the group that don't meet the criteria....
    I used the information in the posts from this forum and UGGGGG! Can anyone help?

  9. #9
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Sum Product with Multiple Conditions

    justkiding1593,

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

+ 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