Conditional Formatting to ONLY Child Row

Hi,

I have applied conditional formatting to my project sheet to change rows to a specific color based on their status. However, I want it to ONLY apply to the child rows. Is there a way make it so my parent rows do not change color?

Answers

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

    Hi Krista,

    Yes, there is.

    You’ll need to add a so-called helper column. I usually call it Level.

    Then you’ll add a formula like below and use the level number to base your conditional formatting rule on.

    =IF(COUNT(CHILDREN(Task@row)) > 0; COUNT(ANCESTORS()) + 1)


    Make sense?

    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(s) 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.

  • Mikah Torres
    Mikah Torres Overachievers

    Hi Andrée,

    Your formula does not differentiate parent/primary tasks from children/sub tasks IF they do not have any children under them. Is there a way to format this so that it only affects children tasks, while also looping children-less parent tasks with the other parent tasks?

    Children tasks will likely be added later in so we know it's a parent, but for now it appears as a child and leads to confusion.


    THanks

  • David Joyeuse
    David Joyeuse ✭✭✭✭✭

    Hi @Mikah Torres

    Just use =COUNT(ANCESTORS()) + 1 then.

    It'll give a level for every tasks. All you'll have to do then is condition formatting depending on the level you want to display.

  • Mikah Torres
    Mikah Torres Overachievers

    Looking more into this, I think I've found a solution that works if you're looking to only add conditional formatting to child tasks.


    =COUNT(ANCESTORS([Project Title]1))


    This will provide a 0 for all parents (even with no children), and a 1 for all children tasks. You can then add a conditional formatting rule based on if this column has a 0 or 1 in it.

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

    Hi @Mikah Torres

    There are several ways to structure it, as you've noticed.

    Glad you got it working!

    Be safe and have a fantastic weekend!

    Best,

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

    Did my post(s) 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!