ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Subtraction of 2 numbers/cells (https://www.excelbanter.com/excel-discussion-misc-queries/261209-subtraction-2-numbers-cells.html)

Cipri

Subtraction of 2 numbers/cells
 
Could anyone please help me with this situation (in Excel 2003):
I have 2 cells
A1 = 0 and B1 = 10
In cell C1 i put this formula C1=A1-B1 . Now the answer will be C1=
-10 but my question is:
Is there a formula to calculate in C1 the result if the answer is positive
and if the answer is negative to put 0?

Thank you in advance.

מיכאל (מיקי) אבידן

Subtraction of 2 numbers/cells
 
Try one of two:
=(A1-B1)*(A1B1)
=(A1-B1)*(A1=B1)
Micky



"Cipri" wrote:

Could anyone please help me with this situation (in Excel 2003):
I have 2 cells
A1 = 0 and B1 = 10
In cell C1 i put this formula C1=A1-B1 . Now the answer will be C1=
-10 but my question is:
Is there a formula to calculate in C1 the result if the answer is positive
and if the answer is negative to put 0?

Thank you in advance.


Cipri

Subtraction of 2 numbers/cells
 
It worked your solution and in the mean time i found another one that works
too :)
if(A1<B1,"0",A1-B1)

Thx dude

"מיכאל (מיקי) אבידן" wrote:

Try one of two:
=(A1-B1)*(A1B1)
=(A1-B1)*(A1=B1)
Micky



"Cipri" wrote:

Could anyone please help me with this situation (in Excel 2003):
I have 2 cells
A1 = 0 and B1 = 10
In cell C1 i put this formula C1=A1-B1 . Now the answer will be C1=
-10 but my question is:
Is there a formula to calculate in C1 the result if the answer is positive
and if the answer is negative to put 0?

Thank you in advance.


Bernard Liengme[_2_]

Subtraction of 2 numbers/cells
 
But do not put the zero in quotes, that will make it text
if(A1<B1,0,A1-B1)
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Cipri" wrote in message
...
It worked your solution and in the mean time i found another one that
works
too :)
if(A1<B1,"0",A1-B1)

Thx dude

"מיכאל (מיקי) אבידן" wrote:

Try one of two:
=(A1-B1)*(A1B1)
=(A1-B1)*(A1=B1)
Micky



"Cipri" wrote:

Could anyone please help me with this situation (in Excel 2003):
I have 2 cells
A1 = 0 and B1 = 10
In cell C1 i put this formula C1=A1-B1 . Now the answer will be
C1=
-10 but my question is:
Is there a formula to calculate in C1 the result if the answer is
positive
and if the answer is negative to put 0?

Thank you in advance.



David Biddulph[_2_]

Subtraction of 2 numbers/cells
 
=MAX(0,A1-B1)
--

David Biddulph


"Cipri" wrote in message
...
Could anyone please help me with this situation (in Excel 2003):
I have 2 cells
A1 = 0 and B1 = 10
In cell C1 i put this formula C1=A1-B1 . Now the answer will be C1=
-10 but my question is:
Is there a formula to calculate in C1 the result if the answer is positive
and if the answer is negative to put 0?

Thank you in advance.





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

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