+ Reply to Thread
Results 1 to 10 of 10

Sum based on condition

  1. #1
    Forum Contributor
    Join Date
    06-28-2010
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    101

    Question Sum based on condition

    Name Amount Total
    A 10
    A 5
    A 15
    B 50
    B 20
    B 10

    Now in third column I would like to sum the total Amount for Distinct Name column values, something like:
    SUM all values in Amount column where Name column values are A,B and so on (Distinct Name column values)

    Can anyone help me on this?

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Sum based on condition

    you can use sumif

    =SUMIF(A1:A5,"A",B1:B5)
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Forum Contributor
    Join Date
    06-28-2010
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: Sum based on condition

    Thanks vlady for the solution But I want =SUMIF(A1:A5,"A",B1:B5) "A" field to be dynamic and copy this formula to the entire column C. Can this be achieved?

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Sum based on condition

    yes if i got you correct like this..

    sumifdummy.xlsx

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Sum based on condition

    I would go with pivot tables
    Attached Files Attached Files
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  6. #6
    Forum Contributor
    Join Date
    06-28-2010
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: Sum based on condition

    Awesome vlady and Ace_XL :D Thanks a lot
    btw Ace_XL can you please tell me how can I do that pivot table on my own?

  7. #7
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Sum based on condition


  8. #8
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Sum based on condition

    your welcome.
    thanks.

    edit : late posting..

    ---------- Post added at 02:34 PM ---------- Previous post was at 01:55 PM ----------

    thanks for the rep...can you mark this thread " SOLVED"
    look at below my signature for steps.
    thanks again for your time.

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,347

    Re: Sum based on condition

    Hi vlady,

    Your formula in cell G2 has a problem. You had it as:
    =SUMIF(A2:$A$16,F2,$B$2:$B$16)

    And when you pulled it down it became:
    =SUMIF(A3:$A$16,F3,$B$2:$B$16)

    I caught this by looking at the Pivot Table posted by Ace_XL and found the B and C sums different.

    I believe you need a dollar sign in front of the 2 in A2. This made your answer wrong.

    The correct formula should have been:
    =SUMIF($A$2:$A$16,F2,$B$2:$B$16)
    and then pull it down.

    ---------- Post added at 11:55 PM ---------- Previous post was at 11:52 PM ----------

    @ vlady -
    Read my post above to see why you got the wrong answer. You might PM the OP and make sure he isn't doing important financial work with your formula.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  10. #10
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Sum based on condition

    OH..,

    didn't notice that i just hit F4...

    PM OP now. thank you very much.

+ 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