Seemingly simple formula will not work

I have a parent cell that should be looking at its children for a value, and if it finds that value in any of the children, it should display that value in itself, else nothing. This seems pretty straight forward, but it's not working. It is, instead, displaying the value regardless of what the children cells have as contents, including nothing at all. Or even if it has no children!

This is the formula:

=IF(COUNT(CHILDREN([Fail Column]@row)) = COUNTIF(CHILDREN(), "FAIL"), "FAIL", "")

And here's a slimmed-down version of the sheet:

https://app.smartsheet.com/b/publish?EQBCT=d1d1b1b95a774fd7aaed09494c6d1546

Help?


Thanks,

Suzanne

Answers

  • Jayesh Nathani
    Jayesh Nathani ✭✭✭
    edited 02/13/20

    Hi Suzanne,

    You were not using the Primary column which has the Parent/Child relationship, try this:

    =IF(COUNT(CHILDREN([Test Category/Test Cases]@row)) = COUNTIF(CHILDREN(), "FAIL"), "FAIL", "")

    The second reason why it didn't work was because there was no Children of Primary column, so it was counting Childrens as 0.

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

    Hi Suzanne,

    I changed the formula to the following.

    =IF(COUNT(CHILDREN([Fail Column]@row)) > 0, "FAIL", "")

    Would that work?

    I hope that helps!

    Have a fantastic week!

    Best,

    Andrée Starå

    Workflow Consultant / CEO @ WORK BOLD

    ✅Did my post help 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.

  • @Andrée Starå Well yes, that works just perfectly, and I understand it. I guess I was over-complicating things. The revelation that COUNT only counts non-empty cells is a big deal here.

    Just to help me build my repertoire or formula rules and regs in my head, in the answer above from Jayesh, he calls out not using the "Primary column which has the Parent/Child relationship" is a problem...that is not actually accurate, is it? Even for that version of the formula (which does not work, btw)? Doesn't make sense to me that a column that has nothing to do with the subject matter at hand would need to be pulled into the equation.

    Thanks in advance, and as usual,

    Suzanne

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

    @siouxzie7

    Sorry! I missed this post.

    No, the formula doesn't need to reference the primary column, only a column that has children rows.

    Make sense?

    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!