+ Reply to Thread
Results 1 to 5 of 5

Calculate negative values

  1. #1
    Registered User
    Join Date
    05-06-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    24

    Calculate negative values

    Hi All,

    I have a problem with a formula I am using to calculate reserve storage.

    I have tried using an advanced formula but it is not producing the result I need. Rather, my formula is displaying negative values in some cases (see attached reference file highlighted cell E13).

    If the formula is going to produce a negative value, I want it to display a blank cell instead.

    I have attached a working file for reference.

    Can someone point me in the right direction PLEASE?

    Thanks
    Attached Files Attached Files
    Last edited by creativefusion; 05-19-2009 at 06:33 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    Re: Calculate negative values

    Hi,

    In E2 and copied down:

    =IF(A2="",IF(((B2*C2)-(D2/2))/(D2)<0,0,((B2*C2)-(D2/2))/(D2)),0)
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Calculate negative values

    or simplified

    =IF(A12="",IF(B12*C12*2<D12,0,(B12*C12-D12/2)/D12)),0)
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculate negative values

    Another alternative

    E2: =MAX(0,((B2*C2)-(D2/2))/D2)*(A2="")
    copied down

    If you want 0 to appear as blank use a Custom Format of: [=0]"";0.00

  5. #5
    Registered User
    Join Date
    05-06-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: Calculate negative values

    Guy's thanks heaps for the help.

    This works a treat.

    If it wasn't for this forum, I would be in so much strife at work!!

    Great work and thanks again.

+ 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