+ Reply to Thread
Results 1 to 8 of 8

Subtraction stop at zero formula

  1. #1
    Registered User
    Join Date
    09-24-2013
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    38

    Subtraction stop at zero formula

    I'm trying to work on a spreadsheet to value inventory at the month it was produced. See the attached spreadsheet for an example. Essentially in C8 I want to deduct the production amount from the inventory amount. After CM I would only have 265 units left. I want to repeat the process going to the left until all units of inventory are accounted for. The part I'm struggling with is I want the formula to stop at 0, so E8 should have 82.. I could do an ABS for this amount but I want the rest of the cells going to the right to all say 0. Help is appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Subtraction stop at zero formula

    do you want to do something like this

    Please Login or Register  to view this content.
    (eg if I put it in H8) where the G8-H2 is whatever your current formula is
    which just says give me 0 if the calculation results in below 0?
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,705

    Re: Subtraction stop at zero formula

    You could put this formula in C8:

    =MAX($B2-SUM($C2:C2),0)

    then copy across. Copy that row of formulae down on alternate rows.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    09-24-2013
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Subtraction stop at zero formula

    It doesn't quite get me there. Following your formula I get a value of 265 in C8. Itt should be 178 since thats the total units of production from the current month which contribute to our ending inventory. D8 should be the full 182 and E8 should be 83 which is the remainder of all units. F8:H8 should all read zero.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,461

    Re: Subtraction stop at zero formula

    How about in C8:

    =MIN($B2-SUM($B8:B8),C2)

    Drag down and accross
    Quang PT

  6. #6
    Registered User
    Join Date
    09-24-2013
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Subtraction stop at zero formula

    I retract my statement it works. I was tryuing to do the SUM in C8 which is creating a circular reference. Thanks!!!!!
    Last edited by JTR616; 04-27-2017 at 09:51 PM.

  7. #7
    Registered User
    Join Date
    09-24-2013
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Subtraction stop at zero formula

    Nevermind it works now. Thanks everyone who replied!
    Attached Files Attached Files
    Last edited by JTR616; 04-27-2017 at 09:51 PM.

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,461

    Re: Subtraction stop at zero formula

    Why dont you try to follow my formula instructtion:

    In C9:

    =MIN($B2-SUM($B9:B9),C2)

+ 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. Range Subtraction / Matrix Subtraction - Large data set
    By excelrabbit in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-20-2015, 07:07 AM
  2. [SOLVED] Subtraction Formula
    By Dowjd in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-23-2013, 02:12 PM
  3. need help with a subtraction formula
    By adelissa in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-10-2011, 12:57 PM
  4. formula for subtraction
    By Ali Khan in forum Excel General
    Replies: 1
    Last Post: 05-16-2008, 08:58 AM
  5. subtraction formula
    By Durzan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2006, 04:10 AM
  6. subtraction formula
    By kaustubhghag in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-24-2006, 08:14 AM
  7. IF formula with subtraction
    By emily''''s excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2005, 01:10 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