SOLVED

# if 0 do nothing

Copper Contributor

# if 0 do nothing

What formula do I use for if 0 do nothing? I am counting inventory. My formula applied even if my count was 0 giving me final values that were negative.  If the count is 0 then I don't want the formula to apply.

4 Replies

# Re: if 0 do nothing

What does your formula currently look like?

# Re: if 0 do nothing

basically it's E9-25 (the weight of a keg of beer minus the weight of the empty keg.  So if E9 is 0 I end up with -25 but what I want is 0

best response confirmed by Hans Vogelaar (MVP)
Solution

# Re: if 0 do nothing

A straight forward solution would be:

``=IF(E9<25,0,E9-25)``

A more advanced solution would be:

``=MAX(0,E9-25)``

# Re: if 0 do nothing

that worked!!!! thank you
1 best response

Accepted Solutions
best response confirmed by Hans Vogelaar (MVP)
Solution

# Re: if 0 do nothing

A straight forward solution would be:

``=IF(E9<25,0,E9-25)``

A more advanced solution would be:

``=MAX(0,E9-25)``