+ Reply to Thread
Results 1 to 7 of 7

stop the calculation when balance becomes zero

  1. #1
    Registered User
    Join Date
    05-19-2013
    Location
    mumbai,india
    MS-Off Ver
    Excel 2007
    Posts
    22

    stop the calculation when balance becomes zero

    I have excel worksheet in which rice and salt is distributed to students every day. In that sheet calculation is done every day. I want to stop the calculation when balance of rice or salt becomes zero or negative number. Can anyone suggest me a vba code or any formula.I am attaching sample excel file. I think I have described well in that file. Please help me.
    Attached Files Attached Files

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

    Re: stop the calculation when balance becomes zero

    try this uses max() formula in cells f24.h24 and conditional format to amber when running total exceeds stock also red when total exceeds stock
    Attached Files Attached Files
    "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

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: stop the calculation when balance becomes zero

    This can get you started.

    J6=if(SuM($F$6:F6)>$F$4,"",SuM($F$6:F6))
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    05-19-2013
    Location
    mumbai,india
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: stop the calculation when balance becomes zero

    hi Martindwilson,
    your formula shows red colour but when rice or salt is not in balance we cannot show the numbers for distribution. the values for red coloured portion should be either blank or zero. i.e. the formula that is present in that red cell should not work. thankyou very much.
    Last edited by excellover2212; 09-01-2013 at 07:06 AM. Reason: respect

  5. #5
    Registered User
    Join Date
    05-19-2013
    Location
    mumbai,india
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: stop the calculation when balance becomes zero

    hi oeldere,
    you have given right formula but the cell f6 contains a formula already. i want to do that as soon as the balance of rice becomes zero or negative the formula in the cell in F column should not work. Thank you.

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

    Re: stop the calculation when balance becomes zero

    try in f6
    =IF(C6*0.5+SUM($F$5:F5)>$F$4,0,C6*0.5)

  7. #7
    Registered User
    Join Date
    05-19-2013
    Location
    mumbai,india
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: stop the calculation when balance becomes zero

    Dear martind wilson
    thank u very much. your formula works correctly. you are genius.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Outstanding Balance calculation
    By Marvwade in forum Excel General
    Replies: 2
    Last Post: 01-26-2012, 08:12 PM
  2. Calculation worksheet to balance dividends for shareholders
    By excel stumped in forum Excel General
    Replies: 3
    Last Post: 04-25-2011, 08:07 AM
  3. Balance Calculation
    By shajms75 in forum Excel General
    Replies: 2
    Last Post: 04-01-2011, 05:29 AM
  4. Balance Calculation
    By Michaela.cotty in forum Excel General
    Replies: 6
    Last Post: 12-30-2010, 12:04 PM
  5. Running Balance Calculation - with timestamp parameters
    By Push Latency in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-30-2007, 04:19 PM

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