MrExcel Publishing
Your One Stop for Excel Tips & Solutions

display zero if the calc is negative


Posted by dustymontana on January 23, 2002 8:25 AM

I want to display zero if my calculation results in a negative number.
Thanks


Posted by Steve Hartman on January 23, 2002 8:35 AM

=IF(calculation<=0,0,calculation)

Posted by Aladin Akyurek on January 23, 2002 8:39 AM


=MAX(0,the-calculation)

========

Posted by Juan Pablo G. on January 23, 2002 9:07 AM

If it's only a "display" issue, i'd go with custom formatting the cell with something like

0;\0;0

The second one "\0", tells Excel to put a "0" string when the result is negative.

Juan Pablo G.