ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Make cell value zero if cell formula returns value less than zero? (https://www.excelbanter.com/excel-discussion-misc-queries/131450-make-cell-value-zero-if-cell-formula-returns-value-less-than-zero.html)

Fred Ernst[_2_]

Make cell value zero if cell formula returns value less than zero?
 
Is there an easy way, such as a format setting, to make a cell value zero if
the cell's formula returns a value less than zero?

I've used a conditional statement with the SIGN function before, but I have
existing cells with formulas that I would just like to apply a format to if
possible.

=IF(SIGN(+L7+N7+P7-K7)=-1,0,+L7+N7+P7-K7)


Thank you,
Fred



Pete_UK

Make cell value zero if cell formula returns value less than zero?
 
Try this:

=MAX(L7+N7+P7-K7,0)

Hope this helps.

Pete

On Feb 20, 4:49 pm, "Fred Ernst" wrote:
Is there an easy way, such as a format setting, to make a cell value zero if
the cell's formula returns a value less than zero?

I've used a conditional statement with the SIGN function before, but I have
existing cells with formulas that I would just like to apply a format to if
possible.

=IF(SIGN(+L7+N7+P7-K7)=-1,0,+L7+N7+P7-K7)

Thank you,
Fred




Duke Carey

Make cell value zero if cell formula returns value less than zero?
 
Try:

=max(L7+N7+P7-K7,0)

"Fred Ernst" wrote:

Is there an easy way, such as a format setting, to make a cell value zero if
the cell's formula returns a value less than zero?

I've used a conditional statement with the SIGN function before, but I have
existing cells with formulas that I would just like to apply a format to if
possible.

=IF(SIGN(+L7+N7+P7-K7)=-1,0,+L7+N7+P7-K7)


Thank you,
Fred





All times are GMT +1. The time now is 08:04 PM.

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