Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

Formula to Count Children Tasks Only

✭✭✭
edited 12/14/23 in Formulas and Functions

I am looking for a formula to count Children tasks that meet specific criteria. I want to see how many tasks (Children only) do not have a task owner and a "LM" flag is set.

The formula below provides a count for ALL tasks (Parent and Children):

=COUNTIFS([Assigned To]:[Assigned To], "", Reporting:Reporting, <> "LM")

I can add a column (Is Parent) to the sheet to indicate that the task is a Parent or a Child using this formula:


=IF(COUNT(CHILDREN()) = 0, "N", "Y")

And then add this criterion to the main formula. 

=COUNTIFS([Assigned To]:[Assigned To], "", Reporting:Reporting, <>"LM", [Is Parent]:[Is Parent], "N")

I want to avoid adding a field to my sheet.

I tried using the formula below:

=IF(COUNT(CHILDREN([Task Name]:[Task Name])) > 0, COUNTIFS([Assigned To]:[Assigned To], "", Reporting:Reporting, <> "LM"))

However, this formula returns the same count as the formula above.

Thanks in advance for your help!

Answers

  • ✭✭✭✭✭✭

    Formula to Count Children Tasks Only

    Try the following, which will eliminate the Is Parent column, =COUNTIFS([Assigned To]:[Assigned To], "", Reporting:Reporting, <> "LM", Reporting:Reporting, COUNT(CHILDREN(@cell))=0)

    If you want to keep the Is Parent column, =COUNTIFS([Assigned To]:[Assigned To], "", Reporting:Reporting, <> "LM", [Is Parent]:[Is Parent], "N")

  • Community Champion

    If you do not want to add a helper column to the sheet to identify the parent rows, is there anything already on the sheet in an existing column, that identifies them? Maybe a naming convention that is used? If so you could add another criteria, for example if the primary column included the word "parent", this would work

    =COUNTIFS([Assigned To]:[Assigned To], "", Reporting:Reporting, <>"LM", [Primary Column]:[Primary Column], CONTAINS("parent", @cell))

  • ✭✭✭

    Eric,

    Thanks for the feedback. When entering the formula I get the famous #UNPARSEABLE message. Also, didn't include one important requirement; I need to add the formula in a field in the Sheet Summary and not the main sheet. I get the #UNPARSEABLE message in both locations.

  • ✭✭✭

    KPH,

    Thanks for the feedback; unfortunately, I don't have anything else that will distinguish a task as a parent or a child.

  • ✭✭✭✭✭✭

    Gotcha! I tweaked a few things so here you are.

    =COUNTIFS([Assigned To]:[Assigned To], ISBLANK(@cell), Reporting:Reporting, NOT(@cell = "LM"), [Is Parent]:[Is Parent], "N")

    NOTE, for the reporting column, you can use <> for not, which will only evaluate non-blank cells that are not LM, or you can use NOT(@cell= "LM") which will also look at blank cells (this is my preferred so am using it, lol)

  • ✭✭✭

    @Eric Law ,

    Thank you for the response and the new formula!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions

  • I'm trying to create a SUMIF formula that looks at the salesperson name in a column and adds up or totals their $ sales in another column. To ultimately show in Dashboard of Totals Sales by Salesperso…
    User: "Allan Z"
    Answered ✓
    9
    2
  • Good day Smartsheet Team, Getting an unparseable error on this formula: =IF($Name@row <> "",(SUMIFS({Expense}, {Period},1, {Type}, OR(@cell = "RES602782", @cell = "RES602497")),"") Trying to pull in a…
    User: "stratman"
    Answered ✓
    15
    2
  • I have a sheet that compiles all the responses from a form. The sheet has multiple start and end date columns, but only one start and one end date cell is NOT blank depending on the activity selected …
    User: "m_anderson"
    Answered ✓
    13
    2