Setting any negative number to zero

K

kim

I have an IF function and I want to add that if the end result ends up beign
a negative number, it should be set it to zero rather than the negative
number. But I don't know how to do that in conjunction with an already
complete If statement. Any help is much appreciated. Thank you
 
G

Gord Dibben

Example...........but only guessing since I haven't seen your formula.

=IF(E2-F2<0,0,E2-F2)

Or

=MAX(0,(B30-1000)/1000*E2+D2)

Always best to post your fromula when asking questions like this.


Gord Dibben MS Excel MVP
 
M

Mike Fogleman

=IF(A1-B1<0,0,A1-B1)
If you had supplied your formula, I could have given the full answer. This
would become part of your original formula.

Mike F
 
K

kim

Thanks. here is my original formula:

=IF((J10-3000000)>=2000001,30000,0.015*(J10-3000000))
 
D

Dana DeLouis

Hi. Perhaps another option...

= Max(0, Min(30000, 0.015*(J10 - 3000000)]))

= = =
HTH
Dana DeLouis
 
D

Dana DeLouis

= Max(0, Min(30000, 0.015*(J10 - 3000000)]))

Oops! I forgot that this is my preferred technique...

=MEDIAN(0,0.015*(J10-3000000), 30000)

= = =
HTH
Dana DeLouis


Dana said:
Hi. Perhaps another option...

= Max(0, Min(30000, 0.015*(J10 - 3000000)]))

= = =
HTH
Dana DeLouis

Thanks. here is my original formula:

=IF((J10-3000000)>=2000001,30000,0.015*(J10-3000000))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top