How to count child rows based on assigned to and status

I need a formula that counts child rows (rows that are unchecked in the Parent column), assigned to and status. See screenshot for reference

Screenshot 2022-07-21 112746.png


Answers

  • Tomasz Giba
    Tomasz Giba Community Champion

    Hi Kristin,

    I may misinterpreted what you're trying to achieve but if you are looking for 3 different formulas here is the solution:

    1) counting unchecked check boxes (type into the parent row in the same column):

    =COUNTIF(CHILDREN(), 0) + ""

    count-parent-1.PNG

    2) count assigned:

    =COUNT(CHILDREN()) + ""

    count-parent-2.PNG

    3) count any status (the same formula as above):

    =COUNT(CHILDREN()) + ""

    count-parent-3.PNG


    If this is not what you're looking for, please provide more specific description and we will try to help.

    Tomasz Giba

  • Kristin Fortner
    Kristin Fortner ✭✭

    Hi Tomasz,


    Thank you for your response. I need to count how many tasks are to certain people, then separately count the number of unassigned tasks, with a status of "In Progress", "Not Started", or "Completed", but I don't want it to count the parent rows.

    I am using the following formula currently: =COUNTIFS({*IS INDUCTION - NEW DESIGN TASK MANAGEMENT Range 1}, <>"", {IS INDUCTION - PROJECT PLAN Range 1}, @cell = [Full Name]@row, {IS INDUCTION - PROJECT PLAN Range 2}, OR(@cell = "Not Started", @cell = "Page Created"))


    {*IS INDUCTION - NEW DESIGN TASK MANAGEMENT Range 1}, <>"" is supposed to only count if there is a value in the task column.

    {IS INDUCTION - PROJECT PLAN Range 1}, @cell = [Full Name]@row, counts the assigned to person

    {IS INDUCTION - PROJECT PLAN Range 2}, OR(@cell = "Not Started", @cell = "Page Created")) counts status.


    Right now it is including the parent rows in the count. I need it to not include the parent rows.

  • Tomasz Giba
    Tomasz Giba Community Champion
    edited 07/22/22

    Hi @Kristin Fortner

    Please check if screenshot below is close what your goal is?

    hier count 1.PNG


    Here is how it's done:


    in the PLAN sheet I created additional helper column formula that detects the hierarchy level:

    =COUNT(ANCESTORS(Description@row))

    hier count 2.PNG




    Formulas in the COUNT SHEET:

    I named all Reference Ranges to IS INDUCTION - PROJECT PLAN as a column I referenced:

    Hier - Reference.PNG


    All formulas in the [Task Count] Column:

    TOTAL TASKS:

    =COUNTIFS({IS INDUCTION - PROJECT PLAN Hierarchy Level}, 2)

    image.png



    TOTAL TASKS In Progress

    =COUNTIFS({IS INDUCTION - PROJECT PLAN Status}, Status@row, {IS INDUCTION - PROJECT PLAN Hierarchy Level}, 2)

    image.png

    and drag copy down to Completed




    UNASIGNED TOTAL

    =COUNTIFS({IS INDUCTION - PROJECT PLAN Assigned}, "", {IS INDUCTION - PROJECT PLAN Hierarchy Level}, >1)

    hier count 5.PNG



    UNASIGNED In Progress

    =COUNTIFS({IS INDUCTION - PROJECT PLAN Assigned}, "", {IS INDUCTION - PROJECT PLAN Status}, Status@row, {IS INDUCTION - PROJECT PLAN Hierarchy Level}, 2)

    image.png

    and drag copy down to Completed




    Jan Kowalski TOTAL

    =COUNTIFS({IS INDUCTION - PROJECT PLAN Assigned}, [Assigned To]@row, {IS INDUCTION - PROJECT PLAN Hierarchy Level}, 2)

    image.png


    Jan Kowalski In Progress

    =COUNTIFS({IS INDUCTION - PROJECT PLAN Assigned}, [Assigned To]@row, {IS INDUCTION - PROJECT PLAN Status}, Status@row)

    hier count 8.PNG

    and drag copy down to Completed

    Copy two above formulas to other workers.

    Hope that will help.

    Tomasz Giba

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!