Counting a date diffrence with children

Darren I
Darren I
edited 12/09/19 in Formulas and Functions

Hello,

Does anybody know if there is there a way to make the below formula work? I'm not sure what I'm missing.

I need a count of children where the difference between the task due date and the created date is 1 or less.This one has stumped me.

=COUNTIF(SUM(CHILDREN([Due Date]8) - CHILDREN(Created8)), <=1)

Tags:

Comments

  • Genevieve P.
    Genevieve P. Employee Admin
    edited 11/13/19

    Hi Darren,

    One way you could accomplish this would be with a helper column. You could create a third, hidden column that simply minuses the one date from the other, and drag-fill this down the whole column:

    =[Due Date]@row - [Created]@row

     

    Then in your current formula column, you could count how many of the children display 1 or less in that new helper column:

    =COUNTIF(CHILDREN([Helper Column]:[Helper Column]), <=1)

     

    Cheers!

    Genevieve

  • Darren I
    Darren I
    edited 11/18/19

    Thank you Genevieve,

    The struggle I'm having with a helper column is that if multiple lines are inserted the formula will not populate even though I've copied the formula through out the entire column. Is there a way to make it populate even if more than one row is added?

  • Genevieve P.
    Genevieve P. Employee Admin
    edited 11/18/19

    Hi Darren,

    You’ll see formulas populate automatically when you type in a newly inserted or blank row that is:

    • Directly between two others that contain the same formula in adjacent cells.

    • At the topmost of the sheet if it’s above two rows that have the same formula in adjacent cells. 
    • At the bottommost of the sheet if it’s below two rows that have the same formula in adjacent cells.
    • Above or below a single row that is between blank rows and has formulas.

    Based on this, it sounds like the first point (creating new rows between two rows) should work for your purposes and auto-fill the formula as needed. If you are cutting/pasting multiple rows at one time, all of the rows inserted between the two rows at once will auto-populate. Just make sure you save your sheet, as that's when the auto-fill happens.



    If you're not seeing your formula auto-populate but it fits in one of the categories above, it would be helpful to see a screen capture of your sheet in Grid view, with an example of how/where you are inserting rows. 

    Hope this helps! Let me know, otherwise. 

    - Genevieve 

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!