IF Formula with Children

Joe Rouse
Joe Rouse ✭✭
edited 04/10/20 in Formulas and Functions

Hi everyone,


I am new to Smartsheet so apologies if this has been answered elsewhere.


I am trying to change RYG balls for a parent row based on children rows being marked done or not. I've used this formula which seems to work, but it gets tedious when there are several Child rows to include or if I want to add another Child row. Is there an easier way with the CHILD or PARENT functions?


Thanks!

Joe


=IF(AND(Completed3 = 1, Completed4 = 1, Completed5 = 1, Completed6 = 1), "Green", IF(OR(Completed3 = 1, Completed4 = 1, Completed5 = 1, Completed6 = 1), "Yellow", "Red"))

Answers

  • rgochee
    rgochee ✭✭✭✭

    Joe,

    Here is the formula that will automate the Parent Row for the Child Row Status

    =IF(COUNTIF(CHILDREN(), "Green") = COUNT(CHILDREN(Task1)), "Green", IF(AND(COUNTIF(CHILDREN(), "Green") < COUNT(CHILDREN(Task1)), COUNTIF(CHILDREN(), "Green") > 0), "Yellow", "Red"))


  • Thanks for your help! I think I left something out- I am hoping to have the RYG ball in the Task column and a checkbox in the Completed column, so this formula isn't quite working.



  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭
    edited 04/15/20

    @Joe Rouse

    Hi Joe,

    Try something like this.

    Completed

    =IF(COUNTIF(CHILDREN(Completed@row); 1) = COUNT(CHILDREN(Completed@row)); 1)

    The same version but with the below changes for convenience.

    =IF(COUNTIF(CHILDREN(Completed@row), 1) = COUNT(CHILDREN(Completed@row)), 1)

    Depending on your country/region, you'll need to exchange the comma to a period and the semi-colon to a comma.


    Try this for the Status Column

    =IF(Completed@row = 1; "Green"; "Red")

    The same version but with the below changes for convenience.

    =IF(Completed@row = 1, "Green", "Red")


    Did that work?

    I hope that helps!

    Be safe and have a fantastic week!

    Best,

    Andrée Starå

    Workflow Consultant / CEO @ WORK BOLD

    ✅Did my post help or answer your question or solve your problem? Please help the Community by marking it as the accepted answer/helpful. It will make it easier for others to find a solution or help to answer!

    SMARTSHEET EXPERT CONSULTANT & PARTNER

    Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

    W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35

    Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!