+ Reply to Thread
Results 1 to 7 of 7

Formula to either calculate or 0 based on IF

  1. #1
    Registered User
    Join Date
    07-01-2016
    Location
    London, UK
    MS-Off Ver
    Office 2016 for Mac
    Posts
    3

    Formula to either calculate or 0 based on IF

    Hello,

    I've tried searching for this, but I can't find anything that matches my req. Apologies if I haven't looked hard enough but I'm on the verge of walking out into the ocean.

    I want to replicate the following as a formula:

    IF (B43 > 0) {
    B43*0.2
    }

    I've tried a bunch of SUMIF and IF statements, but I can't figure it out..

    Please help because I'm now waist-deep in water.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula to either calculate or 0 based on IF

    Try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Registered User
    Join Date
    07-01-2016
    Location
    London, UK
    MS-Off Ver
    Office 2016 for Mac
    Posts
    3

    Re: Formula to either calculate or 0 based on IF

    You are an absolute bloody hero. I'm going to gloss over how simple that was and how stupid I am.

    Thanks AlKey!

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula to either calculate or 0 based on IF

    Can the value of B43 ever be negative? If not then you don't even need the logical test.

    =B43*0.2 will suffice, 0*0.2 is still 0

    If negatives are possible in B43, then you could use MAX.

    =MAX(0,B43*0.2)

    No advantage, or disadvantages over AlKey's suggestion, just showing you some alternative methods.

  5. #5
    Registered User
    Join Date
    07-01-2016
    Location
    London, UK
    MS-Off Ver
    Office 2016 for Mac
    Posts
    3

    Re: Formula to either calculate or 0 based on IF

    Hi Jason,

    It's being used to calculate a tax amount as part of a cash flow forecast, so if the gross profit in any given month is negative, I want the cell to print 0, since there is no taxable value.

    What I ideally want is: IF (B43 >= 0) THEN (B43*0.2) ELSE 0

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to either calculate or 0 based on IF

    Quote Originally Posted by Willjcb View Post
    What I ideally want is: IF (B43 >= 0) THEN (B43*0.2) ELSE 0
    Like this...

    =IF(B43>=0,B43*0.2,0)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula to either calculate or 0 based on IF

    Quote Originally Posted by Willjcb View Post
    Hi Jason,

    It's being used to calculate a tax amount as part of a cash flow forecast, so if the gross profit in any given month is negative, I want the cell to print 0, since there is no taxable value.

    What I ideally want is: IF (B43 >= 0) THEN (B43*0.2) ELSE 0
    In that case, either AlKey's suggestion, or MAX will work fine, with AlKey's method you can test for >=0 or >0 they will both return the same result.

+ 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. [SOLVED] Formula to calculate Std Dev based on column value
    By OmniBlue in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-30-2015, 09:22 AM
  2. [SOLVED] Formula to calculate value based on % thresholds
    By JimmyA in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-22-2014, 03:04 PM
  3. Calculate One Value Based on a Formula for Three Other Values
    By SpeakingPeace in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2014, 07:14 PM
  4. [SOLVED] Formula to calculate sum based on 2 criteria
    By superboy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-05-2014, 09:00 PM
  5. Formula to Calculate Age based on date of birth
    By Squint in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-25-2013, 10:05 PM
  6. Formula to calculate value based on reverse percentage
    By aharvestofhealth in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-11-2012, 04:50 PM
  7. Excel 2007 : Calculate Value based on formula result
    By okinawaman in forum Excel General
    Replies: 2
    Last Post: 05-10-2011, 04:12 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