Pulling Parent Task Name and Child name to New Column

Hello!

I am trying to populate a new column that includes the parent and child task names together. Ideally the column would work in this format:

Parent Task

Parent Task - Child Task 1

Parent Task - Child Task 2


I tried using this formula: =PARENT([Project (Level 1)/Task or Milestone (Level 2)]@row) + " - " + [Project (Level 1)/Task or Milestone (Level 2)]@row


But that pulls in the - at the front of the parent task in the new column. is there a formula format that would only pull the - in when there is a child task after the parent?

Best Answer

  • Ray Lindstrom
    Ray Lindstrom ✭✭✭✭✭✭
    edited 11/01/23 Answer ✓

    Hi @kendallmar,

    Let's try wrapping it in an IF statement, so it only uses the delimiters when there is a parent:

    =IF(COUNT(ANCESTORS()) > 0, JOIN(ANCESTORS([Primary Column]@row), " - ") + " - " + [Primary Column]@row, [Primary Column]@row)

    BRgds,

    -Ray

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!