ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help Needed ASAP (https://www.excelbanter.com/excel-discussion-misc-queries/222260-help-needed-asap.html)

casst

Help Needed ASAP
 
I need to subtract one cell from another cell. However, I don't want to see
any negative numbers, instead I only want a zero. For example:

If A2 is 300 and B2 is 150 than C2 should be 150
If A3 is 150 and B3 is 300 than C3 should be 0 (not -150)

Is this possible, and if so, how do I write the formula.

Thanks



Brad

Help Needed ASAP
 
=max(0,a2-b2)
=max(0,a3-b3)
Copy this two equations as necessary
--
Wag more, bark less


"casst" wrote:

I need to subtract one cell from another cell. However, I don't want to see
any negative numbers, instead I only want a zero. For example:

If A2 is 300 and B2 is 150 than C2 should be 150
If A3 is 150 and B3 is 300 than C3 should be 0 (not -150)

Is this possible, and if so, how do I write the formula.

Thanks



Bernard Liengme[_3_]

Help Needed ASAP
 
=IF(A2-B20,A2-B2,0)
OR
=IF(A2B2,A2-B2,0)
OR
=IF(A2-B2,A2-B2,0) ' A positive value is treated as TRUE
OR
=(A2<B2)*(A2-B2)
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"casst" wrote in message
...
I need to subtract one cell from another cell. However, I don't want to
see
any negative numbers, instead I only want a zero. For example:

If A2 is 300 and B2 is 150 than C2 should be 150
If A3 is 150 and B3 is 300 than C3 should be 0 (not -150)

Is this possible, and if so, how do I write the formula.

Thanks





casst

Help Needed ASAP
 
Thank you - this worked!!!

"Brad" wrote:

=max(0,a2-b2)
=max(0,a3-b3)
Copy this two equations as necessary
--
Wag more, bark less


"casst" wrote:

I need to subtract one cell from another cell. However, I don't want to see
any negative numbers, instead I only want a zero. For example:

If A2 is 300 and B2 is 150 than C2 should be 150
If A3 is 150 and B3 is 300 than C3 should be 0 (not -150)

Is this possible, and if so, how do I write the formula.

Thanks




All times are GMT +1. The time now is 11:10 PM.

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