+ Reply to Thread
Results 1 to 8 of 8

CONDTIONAL Sum Formula Help needed

  1. #1
    Registered User
    Join Date
    07-21-2010
    Location
    Coconut Creek, FL
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    6

    Question CONDTIONAL Sum Formula Help needed

    I have a spreadsheet of, basically, 3 columns. One column is a category, one a debit, one a credit. I need a formula that will compare all cells in the category column and if they match, total the figures in the debit column. That formula would also be used for adding up the specific cells in the credit column too.

    e.g. if a cell in column A="Rent" then add that row's cell in column B with all the other B cells that equal "Rent".

    Am I making any sense at all? COUNTIF won't work and neither does SUMIF, and i'm not advanced enough to figure this one out for myself. HELP!!!!
    Last edited by Mikisunshine; 07-22-2010 at 03:36 PM.
    Regards,

    Michele

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

    Re: Need Complicated Formula Help!!!

    If you only want to total column B then you should be able to use SUMIF, i.e.

    =SUMIF(A:A,"Rent",B:B)

    or do you want to add the credits and subtract the debits, in which case either use 2 SUMIFs like

    =SUMIF(A:A,"Rent",C:C)-SUMIF(A:A,"Rent",B:B)

    or SUMPRODUCT like

    =SUMPRODUCT((A2:A100="Rent")+0,C2:C100-B2:B100)
    Audere est facere

  3. #3
    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: Need Complicated Formula Help!!!

    Welcome to the forum, Mikisunshine.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    07-21-2010
    Location
    Coconut Creek, FL
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    6

    Re: Need Complicated IF/THEN Formula Help!!!

    Quote Originally Posted by shg View Post
    Welcome to the forum, Mikisunshine.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.

    Thanks.
    Sorry about that. I hope this is better.

  5. #5
    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: Need Complicated IF/THEN Sum Formula Help!!!

    How about something simple and descriptive: Conditional Sum

  6. #6
    Registered User
    Join Date
    07-21-2010
    Location
    Coconut Creek, FL
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    6

    Re: Need Complicated Formula Help!!!

    Quote Originally Posted by daddylonglegs View Post

    =SUMPRODUCT((A2:A100="Rent")+0,C2:C100-B2:B100)
    Dear Daddy (sorry, couldn't resist)

    OMG I think that's it. I only need to add up one column, i.e. Credit column for Rents, Debit column cells for Maintenance, Commissions, etc. But this seems to work. Wahoo! I just learned something new and am getting better and better at Excel every day. Gosh I love this program. And this forum! Thank you!
    Last edited by Mikisunshine; 07-22-2010 at 03:22 PM.

  7. #7
    Registered User
    Join Date
    12-07-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Need Complicated Formula Help!!!

    Quote Originally Posted by daddylonglegs View Post
    If you only want to total column B then you should be able to use SUMIF, i.e.

    =SUMIF(A:A,"Rent",B:B)

    or do you want to add the credits and subtract the debits, in which case either use 2 SUMIFs like

    =SUMIF(A:A,"Rent",C:C)-SUMIF(A:A,"Rent",B:B)

    or SUMPRODUCT like

    =SUMPRODUCT((A2:A100="Rent")+0,C2:C100-B2:B100)


    How can this formula work if you have many labels for your column A data? In this example, if you had thousands of different labels (rent, utilities, etc).

    In my context, I have a similar problem, but individually setting up formulas for each label is impractical:

    In column A, I have thousands of different customer account numbers. Each account has multiple transactions.
    In column B, I have the dollar value for the transaction. Each row represents a separate transaction.

    I want to find out the total number of dollars spent by each account for the whole year.

    I need excel to find all rows with each account number (column A), and then add the values in Column B.

    Thanks!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: CONDTIONAL Sum Formula Help needed

    TAGPGA,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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