+ Reply to Thread
Results 1 to 5 of 5

Make negative number equal zero with an IF function, however then adding on to the zero

  1. #1
    Registered User
    Join Date
    03-20-2012
    Location
    Sacramento, California
    MS-Off Ver
    Excel 2011
    Posts
    1

    Make negative number equal zero with an IF function, however then adding on to the zero

    I have a sheet where I have a list of products, the par for each product, the inventory for each product, and the order for each product as the column headers. Specifically, in cell B17 the par is 12, in cell C17, the inventory is 13, and in cell D17 it currently has a -1 (because I automatically have it populate with a formula that subtracts cell B17-C17 to get the order for D17). If a negative number appears, I want it to read as zero.

    After the "order" column in column D, I have several columns (Columns E-N) set aside for any private orders that I may have to input. In Column O I have the total. Therefore (continuing with my example) in D17 reads =B17-C17, then in O17, I have the SUM:D17-N17.
    The error occurs when I try to add an IF function. If I set the function to <0, and have any additional private orders that need to be added, the orders that are added up until a positive 1 is reached.

    I hope this makes sense, I could REALLY use the help. Thank you.

  2. #2
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Make negative number equal zero with an IF function, however then adding on to the zer

    I guess in O17 you should input:

    =B17-C17+sum(E17:N17)

    Then you can keep your IF-statement in D17.

    Helpfull?
    Sincerely
    S?ren Larsen

    "Give a man a fish, and you'll feed him for a day. Give a man a fishing rod, and he'll steal your yacht!"

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Make negative number equal zero with an IF function, however then adding on to the zer

    You have a couple of options.

    In cell D17 you could have a formula along the lines of:

    =IF(B17-C17<0,0,B17-C17)

    Alternatively, you could use a customer format on the cell of:

    General;"0"

    Which will display a 0 if the cell contains a negative value, but still treat the value as a negative for sums.

    I'm not quite sure what you're trying to do with O17, could you explain that a little more?

  4. #4
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Make negative number equal zero with an IF function, however then adding on to the zer

    If i understand what you are trying to do you could try something like this.

    in D17 you can use

    =IF(B17-C17<0,0,B17-C17)

    and then in O17 something like this

    =IF(D17-N17<0,0,D17-N17)

    if that is not what you are looking for please attach a sample workbook with desired results and i can figure it out for you.
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  5. #5
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Make negative number equal zero with an IF function, however then adding on to the zer

    in D17 try:

    Please Login or Register  to view this content.

    and in O17 this

    Please Login or Register  to view this content.
    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

+ 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