ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   return 0 instead of a negative # (https://www.excelbanter.com/excel-discussion-misc-queries/66284-return-0-instead-negative.html)

Rusty

return 0 instead of a negative #
 
I just want to do a simple sum and if the sum returns a negative number, I
want to change it to 0.
C6 = 38, D14 = 2, H6 = 43
=(C6+D14)-H6

result is -3 but I want it to show 0

Elkar

return 0 instead of a negative #
 
Try this:

=MAX((C6+D14)-H6,0)

HTH,
Elkar

"Rusty" wrote:

I just want to do a simple sum and if the sum returns a negative number, I
want to change it to 0.
C6 = 38, D14 = 2, H6 = 43
=(C6+D14)-H6

result is -3 but I want it to show 0


Rusty

return 0 instead of a negative #
 
Fixed. Thanks Elkar

"Elkar" wrote:

Try this:

=MAX((C6+D14)-H6,0)

HTH,
Elkar

"Rusty" wrote:

I just want to do a simple sum and if the sum returns a negative number, I
want to change it to 0.
C6 = 38, D14 = 2, H6 = 43
=(C6+D14)-H6

result is -3 but I want it to show 0


JE McGimpsey

return 0 instead of a negative #
 
One way:

=MAX(C6+D14-H6,0)

In article ,
"Rusty" wrote:

I just want to do a simple sum and if the sum returns a negative number, I
want to change it to 0.
C6 = 38, D14 = 2, H6 = 43
=(C6+D14)-H6

result is -3 but I want it to show 0



All times are GMT +1. The time now is 01:24 PM.

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