Check box if child row contain value of parent row

Hi,

I have trouble figuring out a formula that will check the box of the parent row if child row contains the value of parent row. And the formula must work if it's a column formula.

Thank you in advance!

Tags:

Best Answer

Answers

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭
    edited 08/25/21 Answer ✓

    Hi @Christina Lam

    I hope you're well and safe!

    Try something like this.

    =IF([Primary Column]@row = "", "", IF(COUNTIF(CHILDREN([Primary Column]@row), 
    [Primary Column]@row) > 0, 1))
    

    Did that work/help?

    I hope that helps!

    Be safe and have a fantastic day!

    Best,

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

    Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up or/and as the accepted answer. 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.

  • Bassam Khalil
    Bassam Khalil ✭✭✭✭✭✭

    Hi @Christina Lam 

    Hope you are fine, please try the following:

    1- add a helper column call it Level to define if the row is a parent or children and use the following formula and convert it to column format formula:

    =IF(COUNT(CHILDREN([Primary Column]@row)) > 1,COUNT(ANCESTORS([Primary Column]@row) + 1))
    

    2- use the following formula in Alert column and convert it to column format formula to check if you have any children match the parent value:

    =IF(Level@row >= 1, IF(COUNTIFS(CHILDREN([Primary Column]:[Primary Column]),
    [Primary Column]@row) >= 1, 1))
    

    the following screenshot shows the result:


    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"

  • Christina09
    Christina09 ✭✭✭✭✭✭

    @Andrée Starå

    Thank you for your help. Your formula is really close, but for some reason, without the equal sign, it wouldn't work. So I added the equal sign for =[Primary Column]@row) > 0, 1)) and that seems to work.

    =IF([Primary Column]@row = "", "", IF(COUNTIF(CHILDREN([Primary Column]@row), =[Primary Column]@row) > 0, 1))

    Thanks!

    Christina

  • Christina09
    Christina09 ✭✭✭✭✭✭

    @Bassam Khalil

    Thank you for your help, but since I have over 50 columns in there, it would be best to not add an extra helper column and keep it simple. Andree formula works well without adding an extra column.

    Thanks.

    Christina

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭

    @Christina Lam

    Excellent!

    You're more than welcome!

    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!