Equation to sum children, if no children then return value from a different column

Hi - I"m looking for an equation in column A to sum the value of column B for any children rows. However, if there are no children, then I would like the equation to return the value in column B. I have a helper column set up so that parent/child can be distinguished with 0, 1 or 2 value based on hierarchy.

Any guidance much appreciated. Thanks,

Best Answer

  • AKnight
    AKnight ✭✭✭✭
    Answer ✓

    Hi @Karenmst!

    I would make another helper column for children due to a piece of criteria being if the row has no children. You can do this by using =COUNT(CHILDREN()).

    Assuming that new helper column is named "Helper - Children", you can use the following equation for your problem:

    =IF([Helper - Children]@row > 0, SUM(CHILDREN([column B]@row)), [column B]@row)

    I might've misunderstood your question so let me know if that doesn't work!

    Let's connect!

    www.linkedin.com/in/ashleylknight

Answers

  • AKnight
    AKnight ✭✭✭✭
    Answer ✓

    Hi @Karenmst!

    I would make another helper column for children due to a piece of criteria being if the row has no children. You can do this by using =COUNT(CHILDREN()).

    Assuming that new helper column is named "Helper - Children", you can use the following equation for your problem:

    =IF([Helper - Children]@row > 0, SUM(CHILDREN([column B]@row)), [column B]@row)

    I might've misunderstood your question so let me know if that doesn't work!

    Let's connect!

    www.linkedin.com/in/ashleylknight

  • That did the trick!! Thank you so much!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!