Sum of only last child in cell range

Sarbitar
Sarbitar
edited 11/25/24 in Formulas and Functions

Hi there

I would like to count the values of only the last children in the column. Some cells have one indent, some more, so I would like to know the formula, to count only the last indent children. Below is an example what I would like to achieve. The result of the formula should be 350.

Additionaly I would like to provide a range of dates to count from.

Thank You

Best Answer

  • Sarbitar
    Sarbitar
    Answer ✓

    Ok to answer my own question after searching :)

    I created a helper row with this formula:

    =IF(COUNT(CHILDREN(cost@row)) > 0, COUNT(ANCESTORS()) + 1, 0)

    Which gets 0, if row has no children.
    And then to sum everything up:

    =SUMIFS(cost:cost, helper:helper, 0, date:date, >=DATE(2025, 1, 1), date:date, <DATE(2025, 3, 31))

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!