+ Reply to Thread
Results 1 to 5 of 5

If SUM of fromula is Less than zero.

  1. #1
    Registered User
    Join Date
    11-19-2013
    Location
    Geneva
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question If SUM of fromula is Less than zero.

    I have question. I have a formula for i.e. =SUM(A2*C3-B3) now I want to enter 0 in the cell if the answer to the sum is less than 0.
    I have tried a few ways but nothing works, like =if(sum(A2*C3-B3)<0,sum(A2*C3-B3),"")
    Any idea's?

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: If SUM of fromula is Less than zero.

    =MAX( SUM(), 0)

    MAX will return the largest of the array of input values. Since 0 is larger than negative numbers, the MAX will return zero when SUM returns negative.



    EDIT:
    Also
    =SUM(A2*C3-B3)
    is going to assess that math FIRST, to get
    intermediate = A2*C3-B3
    and save that in RAM, and then it will run
    =SUM(intermediate)
    which is going to return the SUM of one term in the list.

    So, in short,
    =SUM(A2*C3-B3) = A2*C3-B3
    except that one on the right will be easier to read!

    So really all you need is, based on this example,

    =MAX(A2*C3-B3, 0)
    Last edited by ben_hensel; 11-19-2013 at 06:15 AM. Reason: caveat on syntax

  3. #3
    Registered User
    Join Date
    11-19-2013
    Location
    Geneva
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: If SUM of fromula is Less than zero.

    Thanks Ben, works a treat. Iam just a novice at this so much appreciated.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: If SUM of fromula is Less than zero.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    11-19-2013
    Location
    Geneva
    MS-Off Ver
    Excel 2010
    Posts
    3

    Lightbulb Re: If SUM of fromula is Less than zero.

    Ok thanks for th headsup

+ 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. Trying to findout Log-In and Log-out fromula.
    By Phaneendra in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-19-2013, 10:54 AM
  2. Selecting fromula
    By Krisverheyen in forum Excel General
    Replies: 7
    Last Post: 07-23-2009, 03:44 PM
  3. Need secret fromula
    By jbartagoodeair in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2009, 09:15 AM
  4. Need a fromula
    By comotoman in forum Excel General
    Replies: 3
    Last Post: 10-03-2005, 12:05 PM
  5. [SOLVED] Is there a fromula for TAB?
    By Bill Maxwell in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2005, 03:06 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