Round to zero?

Scott Abitante
edited 09/13/23 in Formulas and Functions

Hi,

I am creating an inventory sheet for toner. I have it set up so it let's us know when we need to order. But when we have above par the order line will have a negative number in the "Order" column. (ex. -3) To avoid confusion I want to round all negative numbers to show 0. How can I do this. I have search but nothing seems to work.

Current formula: =Par@row - [Current Count]@row

I tried =IF(SUM(Par@row - [Current Count]@row)) >0,"0" but this does not seem to work.

Thanks in advance.

Scott

Best Answer

Answers

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Answer ✓

    Hi @Scott Abitante ,

    Try:

    =IF(Par@row - [Current Count]@row<0, 0, par@row-[current count]@row)

    Help?

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • Amazing! That worked perfect! Thanks for getting back so quickly. Sorry to bother but if you have a minute can you explain the logic behind? Why the duplicate equation? Just so I understand for the future. Still learning the language.

    Scott

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    edited 12/20/20

    Hi @Scott Abitante,

    IF statements are one of the most used functions. The Syntax is:

    IF( logical_expression, value_if_true, [ value_if_false ])

    If the logical expression is true it returns the answer after the ","; if false the next answer.

    You wanted to know if Par - [Current Count] <0 (the logical expression) and if it was you wanted the result to be 0; if it wasn't you wanted the result to be Par-[current count].

    Happy to help anytime. Thanks for using the community.

    Please mark my answer as accepted to close this discussion.

    Be Well,

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • Ah, ok. That makes more sense. Now I can see it. Just like the Matrix. haha So the comma is basically “do this function first, then 0, if not do this function.” That’s where I was confused. Seriously appreciate the help and explanation. Thank you!

    Scott

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!