ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting any negative number to zero (https://www.excelbanter.com/excel-programming/421257-re-setting-any-negative-number-zero.html)

Kim

Setting any negative number to zero
 
Thanks. here is my original formula:

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


"Mike Fogleman" wrote:

=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
"kim" wrote in message
...
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





Rick Rothstein

Setting any negative number to zero
 
Try this...

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

--
Rick (MVP - Excel)


"kim" wrote in message
...
Thanks. here is my original formula:

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


"Mike Fogleman" wrote:

=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
"kim" wrote in message
...
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






Dana DeLouis[_3_]

Setting any negative number to zero
 
Hi. Perhaps another option...

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

= = =
HTH
Dana DeLouis


kim wrote:
Thanks. here is my original formula:

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


"Mike Fogleman" wrote:

=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
"kim" wrote in message
...
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




Dana DeLouis[_3_]

Setting any negative number to zero
 
= 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 DeLouis wrote:
Hi. Perhaps another option...

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

= = =
HTH
Dana DeLouis


kim wrote:
Thanks. here is my original formula:

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


"Mike Fogleman" wrote:

=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
"kim" wrote in message
...
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




All times are GMT +1. The time now is 09:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com