ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Negative number results to show as zero (https://www.excelbanter.com/excel-discussion-misc-queries/116456-negative-number-results-show-zero.html)

Soccer Guy

Negative number results to show as zero
 
I'm creating an inventory order worksheet with predetermined stock levels. As
we update our inventory, these amount are automatically reduced from our
predetermined stock levels. The result from the column is either a positive
number (# of garments to order) or a negative number (overstock).

I'm copying each result to a new cell (so I can know at any given time what
quantity to order) and rounding the number to the closest multiple of 10
(have to order in multiples of 10). I'm using the =Mround (G4,10) function.
It is working great for all items with a positive number but for the items
with a negative number, I'm receiving a #NUM! error.

What I'm trying to achieve is if the result is a negative number I want it
to display as zero in the new cell. Would appreciate any help with this.

Ken Puls

Negative number results to show as zero
 
How about:

=If(G4<0,0,Mround(G4,10))

Ken Puls, CMA - Microsoft MVP (Excel)
www.excelguru.ca

Soccer Guy wrote:
I'm creating an inventory order worksheet with predetermined stock levels. As
we update our inventory, these amount are automatically reduced from our
predetermined stock levels. The result from the column is either a positive
number (# of garments to order) or a negative number (overstock).

I'm copying each result to a new cell (so I can know at any given time what
quantity to order) and rounding the number to the closest multiple of 10
(have to order in multiples of 10). I'm using the =Mround (G4,10) function.
It is working great for all items with a positive number but for the items
with a negative number, I'm receiving a #NUM! error.

What I'm trying to achieve is if the result is a negative number I want it
to display as zero in the new cell. Would appreciate any help with this.


Soccer Guy

Negative number results to show as zero
 
Thank you Ken. Works prefectly. Really appreicate it.


All times are GMT +1. The time now is 05:43 PM.

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