+ Reply to Thread
Results 1 to 10 of 10

Format a cell that causes sum calculation to go over a pre-set number

  1. #1
    Forum Contributor
    Join Date
    07-31-2009
    Location
    Lincoln, USA
    MS-Off Ver
    Excel 2007 and excel 2010
    Posts
    142

    Format a cell that causes sum calculation to go over a pre-set number

    I'm working with Loan amounts and i need to know how to set a excel spread sheet to conditionally format a cell that causes a sum formula to exceed a preset limit.

    Example.


    Said person has 5 loans.

    1. $2000
    2. $1000
    3. $10000
    4. $500
    5. $2000

    Total = $15,500

    I want the spread sheet to Formate the cell that cuased the total amount to exceed $12,000

    In this case the spreadsheet would auto formate the 3rd loan becuase it was the $10,000 loan that cuased the total amount to exceeded the $12,000 limit. Please help.

    I'm on Excel 2003
    Thanks.
    Last edited by fireguy7; 08-06-2009 at 11:46 AM. Reason: issue solved

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Format a cell that causes sum calculation to go over a pre-set number

    Select the cells you are interested in checking, e.g. A1:A6 and go to conditional formatting and select "Formula is"
    Please Login or Register  to view this content.
    and select your formatting (e.g. orange background). as soon as the value would have exceeded 12,000, the cells will turn orange. Does this work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

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

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Format a cell that causes sum calculation to go over a pre-set number

    Use conditional formatting. Let's say those loan values are in the range A2:A6...

    1) Highlight the loan cells A2:A6
    2) Click Format > Conditional Formatting
    3) Click on Condition1 > Formula Is: =SUM($A$2:$A2)>12000
    4) Click on Format > Pattern > Yellow
    5) OK > OK

    Now the loans will light up at the point they pass the 12,000 mark.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    03-08-2007
    Posts
    93

    Re: Format a cell that causes sum calculation to go over a pre-set number

    You'll actually need two rules for each cell. Using the same method mentioned in the two posts above, first check to make sure the cell above didn't trigger the highlight

    Click on Condition1 > Formula Is: =SUM($A$1:$A1)<=12000 - normal format
    Click on Condition2 > Formula Is: =SUM($A$1:$A2) > 12000 - highlighted

  5. #5
    Forum Contributor
    Join Date
    07-31-2009
    Location
    Lincoln, USA
    MS-Off Ver
    Excel 2007 and excel 2010
    Posts
    142

    Re: Format a cell that causes sum calculation to go over a pre-set number

    Thanks Everyone that's a big help.

    Very close to what i need but not in full


    I'm wanting the cell that caused the total amount to over to highlight and only the cell that caused it. With the above formula's it will highlight every cell once the rule is violated.


    Basicly what i'm doing is checking accounts for people that have exceed credit limits and i need to know which specific purchase caused the excess. If i can get this to work i can just type in all the data and look for the highlighted cell.

    Thanks again

  6. #6
    Registered User
    Join Date
    03-08-2007
    Posts
    93

    Re: Format a cell that causes sum calculation to go over a pre-set number

    My post above does what you need. The fomulas apply to cell $A$2. Condition one checks to see if the criteria has already been met. If so, it will have normal formatting. The second condition will highlight if needed.

  7. #7
    Forum Contributor
    Join Date
    07-31-2009
    Location
    Lincoln, USA
    MS-Off Ver
    Excel 2007 and excel 2010
    Posts
    142

    Re: Format a cell that causes sum calculation to go over a pre-set number

    Thanks Seckert that worked It still highlights every cell after the overage which isn't perfect but i can use the basic idea behid the formulas to figure out the rest. You've been a great help. Have a good one.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Format a cell that causes sum calculation to go over a pre-set number

    the solution ChemistB and I originally suggested also highlight the cell you want plus all the others that follow, so how is two CFs better than 1? Just wondering.

    =========
    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Format a cell that causes sum calculation to go over a pre-set number

    how about format A1 as
    =A1>=1200
    A2 down

    =AND(SUM($A$1:A2)>=1200,SUM($A$1:A1)<1200)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  10. #10
    Forum Contributor
    Join Date
    07-31-2009
    Location
    Lincoln, USA
    MS-Off Ver
    Excel 2007 and excel 2010
    Posts
    142

    Re: Format a cell that causes sum calculation to go over a pre-set number

    Thanks to everyone whom replied. It was a great help.

+ 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