Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

#DIVIDE BY ZERO Error Resolution Attempt

Good afternoon! I am trying to replace the #DIVIDE BY ZERO to ready "Update the tasks first!" so I thought =IFERROR(AVG(CHILDREN()) <> 0, 100/ AVG(CHILDREN()), "") would do it. What is the syntax for this please?

image.png

Thank you!

Best Answers

  • ✭✭✭✭✭✭
    Answer ✓

    Hi @Chris Hallo

    Hope you are fine, please try the following formula:

    =IFERROR(IF(AVG(CHILDREN()) <> 0, 100 / AVG(CHILDREN()), "Update the tasks first!"), "")
    

    the following screenshot shows the result:

    image.png


    PMP Certified

    bassam.khalil2009@gmail.com

    ☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"

  • ✭✭✭✭✭✭
    edited 08/03/21 Answer ✓

    @Chris Hallo 

    You are welcome, i will be happy to help you any time.

    PMP Certified

    bassam.khalil2009@gmail.com

    ☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"

Answers

  • ✭✭✭✭✭

    Hey there Chris,

    I think you may have made it too complex. Correct me if I'm wrong, but you're just looking to get the average percent of tasks completed onto a Parent cell of all its children, right?

    I think this would work for you:

    =IFERROR(AVG(CHILDREN()), "")

    Right now you're getting "#Divide by Zero" because Smartsheet recognizes the blank values as 0%. If they're all 0, it causes that error.


    Just a heads up though, you could have this populate automatically if you use the "% Complete column" field option in Project Settings. Right-click any column and select "Project Settings". Then make sure you're on "Dependency Settings" -> Options -> % Complete column:

    image.png

    If you change that to your "Completion %" column, Smartsheet will calculate this for you on all "Parent" cells. It's a weighted average against the Duration field, so you will need to have Start and End Dates for it to calculate properly. Here's Smartsheet's documentation on it: Project Sheet Columns: Start Date, End Date, Duration, % Complete and Predecessors | Smartsheet Learning Center

    If you're not planning on having dates in fields, stick with the solution with the formula I gave you above.

    Let me know how it goes!

    If this answer answers your question, please press "Yes" above - it helps the community (and those random Googlers out there 👀) find solutions like yours faster.

    Cheers,

    Brett Wyrick | Connect with me on LonkedIn

  • ✭✭✭✭✭✭
    Answer ✓

    Hi @Chris Hallo

    Hope you are fine, please try the following formula:

    =IFERROR(IF(AVG(CHILDREN()) <> 0, 100 / AVG(CHILDREN()), "Update the tasks first!"), "")
    

    the following screenshot shows the result:

    image.png


    PMP Certified

    bassam.khalil2009@gmail.com

    ☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"

  • ✭✭✭✭

    Thank you, Brett. Bassam, this is exactly what I was trying to accomplish. I appreciate both of your time :).

  • ✭✭✭✭✭✭
    edited 08/03/21 Answer ✓

    @Chris Hallo 

    You are welcome, i will be happy to help you any time.

    PMP Certified

    bassam.khalil2009@gmail.com

    ☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions