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

1. ## 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

Zak  Register To Reply

2. ## 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)  Register To Reply

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

Thanks a bunch!  Register To Reply

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

You're welcome and thanks for the rep!  Register To Reply

There are currently 1 users browsing this thread. (0 members and 1 guests) 