+ Reply to Thread
Results 1 to 4 of 4

IF statement with IF Statement as logical test, and output if false

  1. #1
    Registered User
    Join Date
    10-18-2011
    Location
    London, England
    MS-Off Ver
    Excel for Mac (16.25)
    Posts
    42

    IF statement with IF Statement as logical test, and output if false

    Hi all,

    I currently have a nested IF statement that outputs a value that can either be a positive or negative integer.

    When the IF statement outputs a negative integer i want to convert that into zero, so that it doesn't incorrectly affect some revenue calculations that depend on it.

    Essentially i'm looking for:

    IF
    (IF Statement) <= 0, output 0,
    Else
    Output IF Statement.

    I have attached the worksheet with the problem in it.
    • The row containing my current formula (that I want to improve) is coloured orange
    • The row containing the subjects of my formula are coloured blue

    Thanks in advance.
    Zak
    Attached Files Attached Files
    Last edited by wetbean; 10-19-2018 at 12:55 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    42,071

    Re: IF statement with IF Statement as logical test, and output if false

    Try this:

    =MAX(your_if_statement,0)

    So, this maybe:

    =MAX(IF(H20=0,(H14-$B$40)*$B$18,IF(H20=1,(H14-$C$40)*$B$18,(H14-$D$40)*$B$18)),0)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Registered User
    Join Date
    10-18-2011
    Location
    London, England
    MS-Off Ver
    Excel for Mac (16.25)
    Posts
    42

    Re: IF statement with IF Statement as logical test, and output if false

    Thanks a bunch!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    42,071

    Re: IF statement with IF Statement as logical test, and output if false

    You're welcome and thanks for the rep!

+ 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] If/then statement with variable in logical test and value fields
    By kahayler in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-15-2017, 01:02 PM
  2. Replies: 5
    Last Post: 12-09-2012, 11:04 PM
  3. If statement logical test range cells
    By rhudgins in forum Excel General
    Replies: 4
    Last Post: 12-07-2010, 04:51 PM
  4. Second Logical test in if statement
    By speakers_86 in forum Excel General
    Replies: 3
    Last Post: 12-18-2007, 03:21 PM
  5. [SOLVED] If statement where the logical test is a range that equals a word
    By Steve o in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  6. If statement where the logical test is a range that equals a word
    By Steve o in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-27-2005, 10:05 AM
  7. Want to change the color of a true/false logical statement with i.
    By gregspainting in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-19-2005, 03:06 PM

Tags for this Thread

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