+ Reply to Thread
Results 1 to 4 of 4

Sum based on criteria and show total only on row that has criteria

  1. #1
    Registered User
    Join Date
    03-21-2012
    Location
    Bay Area, California
    MS-Off Ver
    Excel 2011 & 2010
    Posts
    52

    Sum based on criteria and show total only on row that has criteria

    I have a sheet with acct numbers on Col A, budgets on Col B, expenses on Col C, and balance in Col D. I can loop through the Col C and insert formula (Col B - Col C) in Col D to show their balance but on some instances, folks decide to create sub accounts to manage their funds so I would like to show totals only on main account line. The attached example shows the desired results in Col D.

    THANKS!
    Attached Files Attached Files

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Sum based on criteria and show total only on row that has criteria

    NU2vba,

    Welcome to the forum!
    In cell D2 and copied down:
    =IF(B2="","",B2-SUMIF($A$2:$A$10,A2&"*",$C$2:$C$10))
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    03-21-2012
    Location
    Bay Area, California
    MS-Off Ver
    Excel 2011 & 2010
    Posts
    52

    Re: Sum based on criteria and show total only on row that has criteria

    Quote Originally Posted by tigeravatar View Post
    NU2vba,

    Welcome to the forum!
    In cell D2 and copied down:
    =IF(B2="","",B2-SUMIF($A$2:$A$10,A2&"*",$C$2:$C$10))
    Thank you tigeravatar! I originally approached this by looping through account numbers but using sumif with wildcard makes this so much simpler.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Sum based on criteria and show total only on row that has criteria

    You're very welcome

+ 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