I am trying to return "100%" if the result of the formula is "0"

Marco F
Marco F
edited 10/01/24 in Formulas and Functions

[column A] = Boxes on Hand

[column B] = Target Boxes on Hand

[column C] = Deficit of boxes on hand

[column D] = Deficit percent of target boxes on hand

If target boxes on hand [column B] = 6 and boxes on hand [column A] = 2, then deficit of boxes on hand [column C] =4. The deficit percent of target boxes on hand [column D] is 30%.

However,

If target [column B] = 6 and boxes on hand [column A] = 6, then deficit [column C] =0. Then deficit percent [column D] displays "INCORRECT ARUGUMENT". How do I write the formula to display "100%" in [column D]?

Thanks for your help!

Answers

  • KPH
    KPH ✭✭✭✭✭✭

    I'm afraid I don't understand the formula you are using for Column D.

    How is the deficit 30%? Is it rounded up? A divided by B?

    In the 6/6 case I would expect it to return 1 (if you are dividing boxes on hand by target) which would be 100%, or 0 if you are dividing 0 by 6, or DIVIDE BY ZERO error if you are dividing 6 by 0. INCORRECT ARGUMENT suggests a problem with the formula itself.

    Can you share the formula or logic you are using?

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!