+ Reply to Thread
Results 1 to 14 of 14

Need to sum based on two conditions

  1. #1
    Registered User
    Join Date
    02-22-2012
    Location
    wa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Lightbulb Need to sum based on two conditions

    Hello,
    Please check my requirement and reply if you can. Thanks a ton!

    Case I
    Type Group Description Item Type Price
    Core N Product1a Base 5,767.20
    Core N Product1b Incre 5.77
    Extended N Product2a Setup 0.00
    Extended N Product2b Base 4,374.00
    Extended N Product2c Incre 4.37
    Extended N Product3a Base 200.00
    Extended N Product3b Incre 2.00


    Case 2
    Type Group Description Item Type Price
    Core Y Product1a Base 10,141.20
    Core Y Product1b Incre 10.14
    Extended Y Product2a Setup 0.00
    Extended Y Product2b Base 0.00
    Extended Y Product2c Incre 0.00
    Extended N Product3a Base 200.00
    Extended N Product3b Incre 2.00


    I am looking for this:
    If
    Type = Core
    Group = Y and
    SUM all same item types' prices into the price column of the corresponding core row. (i.e. sum all base prices, sum all incre prices etc)
    Case2 table shows my expected result.

    Can someone please help?

    -M
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    02-22-2012
    Location
    wa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need to sum based on two conditions

    Can someone help please?
    Last edited by minal; 05-01-2012 at 06:56 PM.

  3. #3
    Registered User
    Join Date
    04-20-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2013, 2010, 2007, 2003
    Posts
    99

    Re: Need to sum based on two conditions

    Your model is slightly confusing because the first expected result (cell E14) appears to be the sum of both a core and an extended value. Can you clarify further what you are looking for?

  4. #4
    Registered User
    Join Date
    02-22-2012
    Location
    wa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need to sum based on two conditions

    Yeah..just realized it is confusing.

    I want to sum all the prices, doesnt matter core or not, but the sum should be entered only against core. and the others that we used to sum up (other than core because that will have sum price) should be 0.

    Does this make sense?
    Thank you,
    -M

  5. #5
    Registered User
    Join Date
    02-22-2012
    Location
    wa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need to sum based on two conditions

    "Bump no response"

  6. #6
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Need to sum based on two conditions

    question on post #4:

    if that is the case, why isn't the value in cell E14 of your spreadsheet 10341.2? as i understand per your comment above, you want to add all "Base" prices up and show that value against "Core", similarly for "Incre". there is something more to the logic than that, i have a hunch...
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  7. #7
    Registered User
    Join Date
    02-22-2012
    Location
    wa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need to sum based on two conditions

    Hello,
    Thanks for reply.
    Because i want to sum all Base who have group = Y and all Incre who have group = Y and put that SUM in corresponding CORE row i.e. Sum should be only in Core- Base and Core- Incre. and All other rows that were added to this sum should be 0. and the ones that are not used in SUM should be kept as it is.

    Price 200 for last base is not added because Group = N for this row.
    Thanks.

  8. #8
    Registered User
    Join Date
    02-22-2012
    Location
    wa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need to sum based on two conditions

    Any clue?
    Thanks.

  9. #9
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Need to sum based on two conditions

    see if this helps.
    Attached Files Attached Files

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Need to sum based on two conditions

    just looking at your data...

    you say you want to add if Group = Y. but inthe file you supplied, none of the values in the top table meet that criteria, they are all Group = N?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Need to sum based on two conditions

    @ icestationzbra they say you lean something new every day, well i just did.....

    MATCH(A14&B14&C14&D14,$A$3:$A$9&$B$3:$B$9&$C$3:$C$9&$D$3:$D$9,0)

    I didnt know you could use concatenation in a match() that way. many times i have had to use helper columns to produce that same result, thanks for sharing that

  12. #12
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Need to sum based on two conditions

    @FDibbins: it is a trick that i have learnt on this forum from experts like yourself :-)...

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Need to sum based on two conditions

    nope, just learning as i go, like most of us here

  14. #14
    Registered User
    Join Date
    02-22-2012
    Location
    wa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need to sum based on two conditions

    Thank you very much for superb answer icestationzbra! Works perfectly, I will implement this solution and will ask back to you if I face any more issues
    Really words are not enough...but thank you for your time and sharing knowledge.

    _Minal

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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